필터 지우기
필터 지우기

How to remove the white blank in Axes when using the imagesc function in the Appdesigner?

조회 수: 30 (최근 30일)
I am using the imagesc to show the following 'z' in the Axes when using app designer.How to remove the white blank generated in image drawn using imagesc?
x = (100:200)';
y = (0:.1:20)+ 30;
z = sind(x*y)+x*y/1000;
% plot:
pcolor(app.UIAxes,z);
imagesc(app.UIAxes,x,y,z);
  댓글 수: 2
Jan
Jan 2019년 5월 9일
Do you mean the space between the image and the border of the axes, or between the axes and the figure?
Adam Danz
Adam Danz 2019년 5월 9일
편집: Adam Danz 2019년 5월 9일
I'm assuming it's between the image and axes since 1) the default behavior for imagesc with regular figures is for the axis limits to match the data (ie, no white space) but this is not true in appdesigner axes and 2) there is no space between axes and figures in appdesigner unless the OP wants to change the color of the entire app background.

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

채택된 답변

Adam Danz
Adam Danz 2019년 5월 9일
편집: Adam Danz 2019년 5월 9일
Option 1: tight axes
The easiest solution would be to set the axes to 'tight'.
axis(app.UIAxes, 'tight')
Option 2: set x/ylim
Alternatively, you could set the x and y axis limits to the max/min of your data.
xlim(app.UIAxes, [min(x(:)), max(x(:))])
ylim(app.UIAxes, [min(y(:)), max(y(:))])

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Grid Lines, Tick Values, and Labels에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by