How can I set zero value to white? in mesh plot
Afficher commentaires plus anciens
I want to show zero values in white in the mesh plot so that all components with non-zero values are clearly visible.
my code is:
mesh(A) % A(1202*30)
colorbar
xlim([1 30])
I don't know how to set the colors.

5 commentaires
Rik
le 8 Mar 2023
Have you tried using the colormap function to edit the colormap?
And if you want the values with a value of 0 to be hidden, you could consider replacing them with NaN before using mesh. That way those patches will not show up at all, instead of being white.
Rik
le 10 Mar 2023
Deleted comment:
Thanks a lot.
colormap(parula(12)) wes effective for me
But colormap was effective for one of the plots and my problem is still not solved.
I can't set zero values to white
Rik
le 10 Mar 2023
I recovered the removed content from the Google cache (something which anyone can do). Editing away your question is very rude. Someone spent time reading your question, understanding your issue, figuring out the solution, and writing an answer. Now you repay that kindness by ensuring that the next person with a similar question can't benefit from this answer.
niloofar rahmani
le 13 Mar 2023
niloofar rahmani
le 27 Mar 2023
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Color and Styling dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
