basemap icon indicating copy to clipboard operation
basemap copied to clipboard

pcolormesh can't shiftdata when X,Y are 1 larger than data

Open matt-kendall opened this issue 10 years ago • 1 comments

The pcolormesh docs (as noted in this issue https://github.com/matplotlib/basemap/issues/107) explain that:

"Ideally the dimensions of x and y should be one greater than those of data; if the dimensions are the same, then the last row and column of data will be ignored."

However when I actually try and use Basemap pcolormesh with this shape array, the shiftdata method sometimes fails because the data is not the same shape:

    import numpy as np
    from mpl_toolkits.basemap import Basemap
    x = np.arange(-179, 191, 10)
    y = np.array([50, 51, 52])
    data = np.ones((2, 36))
    xv, yv = np.meshgrid(x, y)
    map = Basemap()
    map.pcolormesh(xv, yv, data, latlon=True)

results in this error (in 1.0.7):

IndexError: Inconsistant shape between the condition and the input (got (3, 37) and (2, 36))

matt-kendall avatar Feb 26 '15 09:02 matt-kendall

Looks like this is still an issue. I (sometimes!) get the following error when trying to create a basemap:

IndexError: Inconsistant shape between the condition and the input (got (181, 361) and (180, 360))

karenamckinnon avatar May 04 '17 23:05 karenamckinnon