Same scaling of colormap in a multipanel spatial plot

I have uploaded a multi panel spatial plot. Notice that all the colorbars have different scale. I want to scale them in a single range. The first colorbar has a range of 1600-1900, 2nd one has 1600-2000, 3rd one is 1700-1900 so on and so forth. This is not suitable for understa ding of the graph. So my question is how to do that thing(same scaling of colorbar of a multipanel spatial plot) in matlab?

 Accepted Answer

Hi Swarendu,
You can find the min and maximum values to each of your data sets. Then use the values to set the ColorLimits property on each of the plot, assuming you are using some kind of a heatmap chart here.
% Assume A,B,C are your data sets
minValue = min([A(:); B(:); C(:)]);
maxValue = max([A(:); B(:); C(:)]);
% HA, HB, HC are handles to each of your plots
HA.ColorLimits = [minValue maxValue];
HB.ColorLimits = [minValue maxValue];
HC.ColorLimits = [minValue maxValue];
Thanks,
Nikhil

4 Comments

Hi Nikhil,
Thanks for your help. This is really nice and it worked for me. One more thing this is not a heat map data, it is concentration of a gas over a location. Another thing I want to ask, is any colormap is there specifically for represent the concentration. Because in my view 'jet' is not siutable for this type of graph. If you could please suggest that will be really helpful.
I'm glad that it worked out. By heatmap chart I meant a MATLAB heatmap. I'm not sure I understand your question on suitable colormap and 'jet not bein sutable' .
Can you please elaborate? What type of chart/plot function are you using currently?
To explain a temperature variation I use jet or for explanation of precipitation i use jet colormap. But to explain the concentration of heat jet colormap is not so good. So i am looking for a colormap which can explain the spatial distribution of the concentration of a gas. I am not using here any colormap. I am taling about pcolor function, which I have used for plotting the above figure. Sorry for misunderstanding. Thank you.
Ok. This looks like a separate question in an area that I do not have expertise. Please post it as a separate question. If my answer resolved your current problem can you please accept my answer.
Thanks

Sign in to comment.

More Answers (0)

Categories

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!