Problem with colorbar in subplot
조회 수: 1 (최근 30일)
이전 댓글 표시
I have made the following code for representing physical measurements in the region of Angola for the twelve months of the year.
All subplots have the same colorbar for easy distinction between months. I want it to have only one big colorbar instead of twelve small ones.
mediamensual=nanmean(datos,3); %this means monthly mean
auxiliar2=max(mediamensual);
m=max(auxiliar2);
mn=0;
f=linspace(0,1,100);
for j=1:12
subplot(3,4,j)
ax = worldmap('angola');
load coastlines
setm(ax, 'Origin', [0 20 0])
plotm(coastlat,coastlon);
hold on
for a=1:190
c=(mediamensual(:,j)-mn)/(m-mn);
color2=[c c c];
lat=coord(a,1);
lon=coord(a,2);
%geoshow('landareas.shp', 'FaceColor', [0.5 1.0 0.5]);
geoshow(ax, lat, lon, 'DisplayType', 'point', 'MarkerEdgeColor', color2(a,:),'Marker', '.', 'MarkerSize', 10)
end
colormap(f'*ones(1,3))
caxis([mn m])
colorbar
end
Any idea is appreciated. Thanks for reading
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Subplots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!