File Exchange

image thumbnail

plot_bar3_colorheig​hts( x, y, Z )

version (434 Bytes) by Johannes Schmitz
3D Barplot with height of the bars coded into the color

1 Download

Updated 10 Jul 2015

View License

3D Barplot with height of the bars coded into the color. Might be used as a 2D Histogram.
- x and y are the centers of the bins
- Z is a matrix containing the heights of the bins

Cite As

Johannes Schmitz (2020). plot_bar3_colorheights( x, y, Z ) (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (5)

Sadaqat Ali

That is nice work for 2 dimensional matrix but it fails to plot dimension > 2.


junmin wang

thank your for adding the example

You use it for example like this:

plot_bar3_colorheights([1 2],[1 2], [1 2; 1 3])

then you get a 2x2 plot.
You have to provide the x component for the centers of the bins and the y component. In this case you have a bins around [1,1] [1,2] [2,1] and [2,2] and the matrix with the heights is in this case obviously a 2x2 matrix.
Is that clear enough?


I couldn't get it to work so i can't really rate. There is no real help provided nor dimensions of inputs. At least one example would be nice...let's say the one that was used to generate the Figure.

MATLAB Release Compatibility
Created with R2014b
Compatible with any release
Platform Compatibility
Windows macOS Linux