필터 지우기
필터 지우기

How to get rid of the white space when using subplot1 with imagesc?

조회 수: 4 (최근 30일)
Maria
Maria 2017년 3월 23일
편집: Jan 2017년 3월 25일
Dear MATLAB experts,
I have used subplot1 as follows: subplot1(5,4,'Min',[0.010 0.010],'Max',[0.99 0.99],'Gap', [0.01 0.05], 'XTickL', 'None', 'YTickL', 'Margin'); imagesc(data(:,:,11,100)); The result is shown below.
Is there any way to get rid of the white space abowe and on the right side of the figures? I would also like to resize the subplots so that they have equal weight and height (i.e. each subpot would be rectangular).
Best, Maria
  댓글 수: 1
Jan
Jan 2017년 3월 23일
편집: Jan 2017년 3월 25일
It is not a good idea to let us guess, what subplot1 is. You do not mean the white space on the "figure", but this concerns the image inside the axes. Then there is no relation to subplot1, but this is a question concerning imagesc.

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

채택된 답변

Jan
Jan 2017년 3월 23일
When I guess that you use FEX: subplot1, this command suffers from using gca internally and it does not provide the hanlde of the created axes as output. This is prone to errors, iof the user clicks on in any other figure during the creation of the GUI. I'd prefer one of the many other subplot enhancements of the FEX.
But if you want to use subplot1, try:
subplot1(5,4,'Min',[0.010 0.010],'Max',[0.99 0.99], ...
'Gap', [0.01 0.05], 'XTickL', 'None', 'YTickL', 'Margin');
AxesH = gca;
imagesc(data(:,:,11,100));
axis(AxesH, 'tight');
  댓글 수: 2
Maria
Maria 2017년 3월 25일
Many thanks for your answer and sorry if my question was unclear! FEX: subplot1 is the function that I have tried to use. Your example code did exactly what I wanted.
Best, Maria
Jan
Jan 2017년 3월 25일
편집: Jan 2017년 3월 25일
@Maria: You are welcome. Questions for clarifications belong to the standard process of solving a problem. It is the nature of questions in the forum, that the one or other part of it is unclear: if every details is clear to the author, it would not be a problem anymore usually :-)

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

추가 답변 (0개)

카테고리

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