Skip to content

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

@matt-kendall

Description

@matt-kendall

The pcolormesh docs (as noted in this issue #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))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions