필터 지우기
필터 지우기

Problem with colorbar in subplot

조회 수: 2 (최근 30일)
Jaime  de la Mota
Jaime de la Mota 2017년 3월 12일
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개)

카테고리

Help CenterFile Exchange에서 White에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by