Narrow colorbar with tiledlayout

조회 수: 19 (최근 30일)
Jonas Krimmer
Jonas Krimmer 2019년 11월 23일
댓글: Jonas Krimmer 2019년 12월 2일
I've noticed that the colorbars in a "tiledlayout"-plot do not seem to widen increasing the width of the whole figure, making them much narrower than in a subplot-environment. In return there is more space available for the axes themselves. Is this behavior intended? Is there any way to change this?
Thank you very much in advance.
MWE:
h1 = figure;
tlt = tiledlayout(1, 2);
nexttile;
surf(rand(10));
colorbar;
nexttile;
surf(rand(10));
colorbar;
h.Position(3) = 2*h.Position(3);
%
h2 = figure;
ax1 = subplot(1, 2, 1);
surf(rand(10));
colorbar;
ax2 = subplot(1, 2, 2);
surf(rand(10));
colorbar;
h.Position(3) = 2*h.Position(3);

답변 (1개)

Siriniharika Katukam
Siriniharika Katukam 2019년 12월 2일
Hi
Referring this link might be helpful:
Colorbar is used to map data values into the colourmap. So, having its size small(clear enough) would be sufficient.
  댓글 수: 1
Jonas Krimmer
Jonas Krimmer 2019년 12월 2일
Thank you very much for your response and the provided link. Unfortunately, it seems to me that only the manual approach is possible.
I know that a narrower colorbar is sufficient for most applications. However, the possibility to retain the normal, broader colorbar would allow for a more consistent plot layout (in comparison to the old subplot outcome).

댓글을 달려면 로그인하십시오.

카테고리

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