I would like to propose expanding the inputs of pcolor to take vectors. Often, you have x and y independent (seperable), and you don't want to go on constructing an x array of redundant values. Actually, in NumPy it is not straightforward to do this with resize if your variable is in the first dimension like time. This is because NumPy makes heavy use of array broadcasting, so that you don't need to drag around all that redundant data.

I realize that there is meshgrid, but I only use it for plotting (because of array broadcasting), and only with two vectors (see the second example below). I think MPL would benifit from following the spirit of array broadcasting, and make it such that:

x = arange(10)

y = arange(30)

z = rand(30,10)

pcolor (x, y, z)

will work as expected. Perhaps, we could require a NewAxis in the right places, but it would also make sense without. We could also consider the case of just one vector. Consider

x,y = meshgrid(arange(10), arange(30))

y = y + random.normal(size=y.shape)

z = random.random(y.shape)

pcolor (x, y, z)

# but x is still essentially just arange(10), so it would be nice if this worked, too.

pcolor(arange(10), y, z)

What do you all think?

-Rob.

## ···

-----

Rob Hetland, Assistant Professor

Dept of Oceanography, Texas A&M University

p: 979-458-0096, f: 979-845-6331

e: hetland@...345..., w: http://pong.tamu.edu