plot two contours in the same figure with decoupled colorbar
2 次查看(过去 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
0 个评论
回答(1 个)
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 个评论
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 Center 和 File Exchange 中查找有关 Colormaps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!