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

  • MATLAB
  • Thread starter mikeph
  • Start date
  • #1
1,233
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
Gold Member
2,485
608
scale each image the same and then turn off one of the colorbars, they are not necessary for each subplot
 

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

Replies
1
Views
21K
Replies
4
Views
909
Replies
1
Views
832
  • Last Post
Replies
1
Views
7K
  • Last Post
Replies
2
Views
4K
Replies
14
Views
7K
  • Last Post
Replies
0
Views
12K
Replies
1
Views
17K
Top