[Matplotlib-users] Pcolormesh vs contourf

Jody Klymak jklymak at uvic.ca
Sat Jan 7 15:31:28 EST 2017

Hi Eric, Sameer

> I view the way pcolormesh handles x and y as fundamental, so I am reluctant to add an option to interpolate/extrapolate a pixel-centered grid to the the edge grid that pcolormesh absolutely requires.  In the simplest cases, such as a uniform rectangular grid, such a transformation is straightforward, but in the more general cases that pcolormesh handles, it is not; there is no single algorithm that would "do the right thing" in all cases.

Maybe I’ve misunderstood, but in 1.5.x, if I run pcolormesh with len(x) = m, len(y) = n and size(z) = m,n then it works just fine (like matlab’s implimentation).  its great that it also does m+1 and n+1, but I think it does the “easy” thing.  Maybe in 2.0 this has changed?  

To the original question: pcolormesh(x,y,z,rasterized=True) is your friend if m and n are large and you want to print things.

Cheers,   Jody

> There is scope for making it easier to do common things, but rather than fold it into functions like pcolormesh, I think it is better to break it out into standalone grid manipulation functions.
> We also have a NonuniformImage class that handles irregular (and regular) rectangular pixel-centered grids, and can be used directly. That class needs an Axes method and a pyplot function.
> Eric
>> It's not hard to do but something that could be considered if there are
>> enough use cases.
>> Sameer
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users at python.org <mailto:Matplotlib-users at python.org>
> https://mail.python.org/mailman/listinfo/matplotlib-users <https://mail.python.org/mailman/listinfo/matplotlib-users>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20170107/d5a1e5d2/attachment-0001.html>

More information about the Matplotlib-users mailing list