plot two contours in the same figure with decoupled colorbar

6 次查看(过去 30 天)
does any know how do plot two sets of contour plot on a single figure, but have a decoupled colorbar?
basically, i have two datasets and
the first data set is in the format
[latitude longitude -depth]
the second data set is in
[latitude longitude +SPL level]
if i plot them together with 'hold on', the positive SPL values are all shown on the top end of colorbar and the negative value are shown on the bottom end of the colorbar, which means I only have red and blue and nothing in between.
so i would like to show the full color range of both dataset by decoupling the z-axis and display colorbar only for the second dataset.
I hope i made it clear enough
Thanks in advance!
Regards

回答(1 个)

Walter Roberson
Walter Roberson 2015-9-28
Experiment with using caxis(), passing in the minimum and maximum values that you want to colorbar to cover. I am not certain that this will give you the overall color that you want, though.
  2 个评论
Sei Him Cheong
Sei Him Cheong 2015-9-29
Hi Walter, Thanks for the comment. I did use Caxis to alter the color range, but not getting any good result as the water depth data ranges from 10 to 5000 but the SPL data are only within 0-150. So I am not getting good color resolutions.
Walter Roberson
Walter Roberson 2015-9-29
If you are using R2014b or later you can plot them in different axes (which might visually be on top of each other) and use a different colormap for each axes and parent the colorbar to the appropriate axes.
If that does not work or you are using a previous MATLAB then you will need to convert the first plot to RGB instead of pseudocolor, so that the colormap and colorbar can have meaning only for the other data. To do the conversion you can use http://www.mathworks.com/matlabcentral/fileexchange/7943-freezecolors---unfreezecolors

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Colormaps 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by