MATLAB subplot: how to have 1 colorbar for both images?

  • MATLAB
  • Thread starter mikeph
  • Start date
  • #1
mikeph
1,234
18
Title says it all. I have two matrices representing 2D surfaces, and I am using subplot to compare them in the same plat area, however, each has its own colorbar so comparison is not so easy to do by eye.

I'm pretty weak at figure handles, can someone give me a hint to do this? Thanks

Code:
subplot(1,2,1); h1 = pcolor(final); 
set(h1,'EdgeAlpha',0); colorbar
subplot(1,2,2); h2 = pcolor(initial);
set(h2,'EdgeAlpha',0); colorbar

Thanks
 

Answers and Replies

  • #2
Dr Transport
Science Advisor
Insights Author
Gold Member
2,558
714
scale each image the same and then turn off one of the colorbars, they are not necessary for each subplot
 

Suggested for: MATLAB subplot: how to have 1 colorbar for both images?

  • Last Post
Replies
1
Views
22K
  • Last Post
Replies
4
Views
1K
Replies
1
Views
990
  • Last Post
Replies
4
Views
30K
  • Last Post
Replies
1
Views
2K
Replies
1
Views
48K
Replies
1
Views
2K
Replies
5
Views
7K
Replies
7
Views
1K
  • Last Post
Replies
4
Views
4K
Top