How to plot only non-zero positive values in a bar3 graph?
7 views (last 30 days)
Show older comments
This should be trivial but I can't figure it out. I have an NxM matrix, which I am plotting as a bar3 graph. All of them have the same colour (blue), and when a value in the matrix is zero, there is a blue square at the z=0 value, with black edges.
I would like to plot it in a way that the zero values are not plotted. Actually, it would be even better if the black edges of the square (the frame) would be plotted but the inside would be white (i.e. the square would not be filled with blue).
Is there any way to do this?
I attached a picture of how it looks now.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/153046/image.png)
6 Comments
dpb
on 16 Nov 2013
Well, it was a thought that bar might ignore NaNs as does plot...
Too bad. No further ideas other than figuring out how to set the patch values vs the level. My use has been minimal and what attempts have made previously were mostly unsuccessful--I don't fully understand how the patch color map assignment thingie works...
Answers (0)
See Also
Categories
Find more on Annotations in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!