Overlay imagesc and contour in subplot with different colour bars
21 views (last 30 days)
Show older comments
Hi All,
I have an image i would like to produce as part of an array of 6, and I have the following code:
Unwrap = subplot(2,3,5);
hold on
imagesc(G_Unwrapped); title('Phase Change');colorbar, axis square
colormap(Unwrap,'gray')
contour(G_Unwrapped, 'ShowText','on');
hold off
However, as the axis handle applies to the whole subplot, and not the indervidual plot commands I can't think of a way to apply a second colour map too the contour plot.
Many thanks in advanced for any help!
0 Comments
Accepted Answer
Adam Danz
on 17 Mar 2021
Edited: Adam Danz
on 17 Mar 2021
> the axis handle applies to the whole subplot, and not the indervidual plot commands
That's correct. A workaround is to assign two overlapping axes with care so that the axes are linked.
Follow this demo that carefully overlays imagesc and contour
You can easily add two independent colobars to the example above following this similar example,
Give it a shot and if you get stuck, show us what you've got and I can nudge you in the right direction.
2 Comments
More Answers (0)
See Also
Categories
Find more on Subplots 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!