필터 지우기
필터 지우기

subplot axes shrink with colorbar

조회 수: 5 (최근 30일)
Vasco Vieira
Vasco Vieira 2013년 5월 21일
Hi, I do a subplot(2,2,...) with pcolor on each subplot and a colorbar for the plots on the right side. This subplot is repeated t times and an avi movie done with it. Unfortunately, for each new iteration the axes of the right side subplots and the colorbars shrink. If I remove the colorbar everything goes fine. This happens with Matlab 2011a. Workarounds for other axes shrinking bugs did not work and these were solved for previous releases. Thanks

채택된 답변

Image Analyst
Image Analyst 2013년 5월 21일
You can set the 'Position' property of the axes after it resizes it to set it to whatever you want it to be.
set(handleToAxes, 'Position', [x, y, width, height]);

추가 답변 (2개)

Iain
Iain 2013년 5월 21일
a(1) = subplot(2,2,1);
pos1 = get(a,'Position');
a(2) = subplot(2,2,2);
pos2 = get(a,'Position');
add colourbar etc.
set(a(1),'Position',pos1)
set(a(2),'Position',pos2)

Vasco Vieira
Vasco Vieira 2013년 5월 22일
Exactly!
I had thought about manually forcing the axes properties but was wondering whether this was a bug with a solution within the existing code lines instead of worked arround with more code lines.
Thak you very much

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by