![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/923059/image.png)
How to show maximum variation of two dataset using contour plot with single colorbar?
1 view (last 30 days)
Show older comments
I have attached two datasets (data1 and data2). The data1 has max value = 405.47 and min value=403.91. On the other hand, data2 has max value=403.95 and min value=397.18.
My problem is when I am trying to plot both these data using a common range only one plot explicitly shows the variation, whereas, in the other plot no variation is observable. The reason is both the data has very different distribution range.
I could use two different colorbar two show the variation holistically,but, I am looking for a solution using a single colorbar where I could show the variation of this data.
The code I tried so far
data1=load('data1.mat'); data2=load('data2.mat');
subplot(1,2,1)
contourf(data1)
caxis([395,406])
subplot(1,2,2)
contourf(data1)
caxis([395,406])
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/922969/image.png)
The above figure I am getting if I use the above code.
Thank you in advance.
0 Comments
Answers (1)
Mathieu NOE
on 11 Mar 2022
hello
even without caxis , I simply used the jet colormap to have more colored contrasts
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/923059/image.png)
data1=load('data1.mat');
data1= data1.a;
data2=load('data2.mat');
data2=data2.b;
colormap('jet');
subplot(1,2,1)
contourf(data1)
subplot(1,2,2)
contourf(data2)
colorbar('vert');
See Also
Categories
Find more on Orange 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!