-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plotting masked arrays with plot_surface() #487
Comments
I hacked together a very basic solution. Would something like this be suitable? |
Yes, that's what I was looking for. Great. |
And how should the colourmap behave in this case? Normalised to the min/max of the unmasked values? |
Damon McDougall wrote:
I'm plotting measurement data and want to mask all values which |
That would be incorrect in the general case. Often, masked values may be nans or unitialized garbage. As a general rule in mpl, you don't unmask input data. |
Of course, we probably should clarify terminology here... "unmasked" as a verb means to take a masked array and remove its mask So, rereading @AndreasMatthias statement, I think you meant the noun. (whereas I was using the verb) |
@WeatherGod, I was just about to clarify what I meant but I see you got there before me. I meant the noun. I should normalise the colourmap using only the values whose mask evaluates to False. This is exactly what @AndreasMatthias expects as default behaviour. This will require a little more work, since all I did in that picture was to simply not add the polygons to the Poly3DCollection if their mask was True. Would there be wider interest for me to continue my efforts for this cause? |
Oh, absolutely. I would certainly welcome any sort of assistance here. Do note that I am about to embark on a refactoring of the plot_surface code with regards to documentation, shading, facecolors and such. We probably should coordinate so that we don't start stepping on each others' toes here. |
Any progress on this? |
Has anyone else got solutions they can suggest? |
I would be nice if
plot_surface()
could plot masked arrays. Unlikeimshow()
which really plots the masked data,plot_surface()
only plots the non-masked data.Here is an example:
The text was updated successfully, but these errors were encountered: