[Bug] masking of NaN Z values in pcolormesh#5451
Conversation
|
That's reasonable, but I think that instead of putting the |
|
Thanks for the quick reply! You mean putting the check before both of the returns in |
|
In the development of mpl, masked array support predates nan support, which is the reason there are still places like this that need safe_masked_invalid added. |
|
@efiring I could go either way on backporting this to 2.0.x |
|
@andim Looks good. Would you mind squashing the two commits down to one and force-pushing? |
85bb58f to
8928311
Compare
|
I had some trouble at first (I'm new to this more advanced git features), but it should be ok now with the latest commit. Thanks again for your comments and looking forward to seeing this fixed. |
[Bug] masking of NaN Z values in pcolormesh
|
@andim Thanks for your contribution! |
|
@tacaswell It would be great if this feature could be back-ported to 2.0 (except when 2.1 will be released soon). It would help a lot of users coming from Matlab. |
|
The current goal is 2.1 RC in the next month or so. |
|
OK, great! Thank you for the information. |
In
pcolormeshnon-finite values (e.g. NaNs) are not currently masked. The function allows the input of masked arrays, so there is an easy workaround of masking the array before passing it in (see http://stackoverflow.com/questions/7778343/pcolormesh-with-missing-values). It would make more sense IMHO, though, to mask the array internally as is done inimshow. This would fix what I believe is a bug, namely that the autoscaling of the Z axis does not work if the array contains NaNs.