How to define the colorbar for subplots
Show older comments
I have 10 subplots in a figure i want to define one colorbar for the whole figure, However the contour range is different for all the plots
% To plot the mean sea ice drift
left1 = 0.42;
cb_bottom = 0.08 ;
cb_width = 0.20 ;
cb_height = 0.02 ;
subplot(2,5,6)
hold on;
m_proj('stereographic','lat',90,'long',300,'radius',33,'rect','on');
m_grid('linewi',1,'tickdir','out',...
'xtick',6,'ytick',[72 78 84 90]);
m_contourf(long,lat,mdmn_wr,'linestyle','none');
m_coast('patch',[.6 .6 .6]);
xlabel('Mean of Median Winter Sea Ice Drift 1979-2014','visible','on')
% To plot the median sea ice drift
subplot(2,5,7)
hold on;
m_proj('stereographic','lat',90,'long',300,'radius',33,'rect','on');
m_grid('linewi',1,'tickdir','out',...
'xtick',6,'ytick',[72 78 84 90]);
m_contourf(long,lat,mdn_wr,'linestyle','none');
m_coast('patch',[.6 .6 .6]);
xlabel('Median Winter Sea Ice Drift 1979-2014','visible','on')
% To plot the standard deviation of sea ice drift
subplot(2,5,8)
hold on;
m_proj('stereographic','lat',90,'long',300,'radius',33,'rect','on');
m_grid('linewi',1,'tickdir','out',...
'xtick',6,'ytick',[72 78 84 90]);
m_contourf(long,lat,std_mdn_wr,'linestyle','none');
m_coast('patch',[.6 .6 .6]);
xlabel('Standard Deviation of Median Winter Sea Ice Drift 1979-2014','visible','on')
% To plot the Skewness of sea ice drift
subplot(2,5,9)
hold on;
m_proj('stereographic','lat',90,'long',300,'radius',33,'rect','on');
m_grid('linewi',1,'tickdir','out',...
'xtick',6,'ytick',[72 78 84 90]);
m_contourf(long,lat,skw_mdn_wr,'linestyle','none');
m_coast('patch',[.6 .6 .6]);
xlabel(' Skewness of Median Winter Sea Ice Drift 1979-2014','visible','on')
% To plot the flatness of sea ice drift
subplot(2,5,10)
hold on;
m_proj('stereographic','lat',90,'long',300,'radius',33,'rect','on');
m_grid('linewi',1,'tickdir','out',...
'xtick',6,'ytick',[72 78 84 90]);
m_contourf(long,lat,kts_mdn_wr,'linestyle','none');
m_coast('patch',[.6 .6 .6]);
xlabel(' Kurtosis of Median Winter Sea Ice Drift 1979-2014','visible','on')
h = colorbar;
set(h,'location','southoutside',...
'position',[left1 cb_bottom cb_width cb_height] );
4 Comments
Muhammad Usman Saleem
on 7 Apr 2016
Edited: Muhammad Usman Saleem
on 7 Apr 2016
firstly see it
>> m_proj('stereographic','lat',90,'long',300,'radius',33,'rect','on');
Error:
Undefined function 'm_proj' for input arguments of type 'char'.
Walter Roberson
on 7 Apr 2016
Muhammad Usman Saleem comments
there is error in this line of the code. Fix it
Walter Roberson
on 7 Apr 2016
Sophia
on 8 Apr 2016
Accepted Answer
More Answers (0)
Categories
Find more on Vector Fields 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!