Colorbar range: maximum not given
3 views (last 30 days)
Show older comments
Simao Nobrega
on 26 Aug 2015
Commented: Simao Nobrega
on 27 Aug 2015
Hello,
I have two contourf plots (one plane at z=cte and another at y=cte) that have the same maximum temperature, 65.5ºC. When I "ask" matlab for the colorbar, I see that the maximum temperature on the right colorbar plot (y=cte) does not correspond to the true value.
Any ideas why is this happening and what is the best soluiton?
Thank you in advance.
Best regards, Simão
0 Comments
Accepted Answer
Walter Roberson
on 26 Aug 2015
Notice that the blob is mostly off-screen, either because the data is that way or because the ylimit has been set to not show all of it. It is plausible that in what is shown on the plot, the maximum never reaches the full 65.5.
You can use caxis() to control the maximum that colorbar will use.
After the first plot you could use
first_caxis = caxis();
and then after the second plot you could use
caxis(first_caxis);
before you call colorbar()
More Answers (0)
See Also
Categories
Find more on Colormaps 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!