Clear Filters
Clear Filters

How can i print z axis values on a pcolor plot

15 views (last 30 days)
x = [0,10,20,30], y = [100,210,300,500] z = [0 0 0 1; 0 0 1 0; 1 1 0 0; 1 0 0 0];
i tried generating a pcolor plot for above variables such as
pcolor(x, y,z);colormap summer; colorbar
Now I need to display the z values on the plot for every box displayed in the plot and I havent been able to find a way to do so

Accepted Answer

jonas on 15 Aug 2018
Something like this?
hold on;
pcolor(x, y,z);
colormap summer;
jonas on 16 Aug 2018
Edited: jonas on 16 Aug 2018
I am not sure I understand. Can you give me a hint? Perhaps an image?
I'm speculating now but perhaps you can replace the last line of code with this:
Or do you want to change the fontsize? if so:

Sign in to comment.

More Answers (0)


Find more on 2-D and 3-D Plots in Help Center and File Exchange


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!