How do I use 'axis tight' with appdesigner?

조회 수: 39 (최근 30일)
Matt
Matt 2017년 8월 16일
답변: Matt 2017년 8월 17일
Hi, I'm using app designer to display some simple plots, how do i use the 'axis tight' command within the app designer code for the integrated figure?
I've tried this, but its not working as I want:
plot(app.UIAxes, S, Prices);
title(app.UIAxes, 'Price');
axis tight
Thanks for any help in advance!

채택된 답변

Alex Karle
Alex Karle 2017년 8월 17일
Hi Matt,
Try specifying which axis you want to be tight:
plot(app.UIAxes, S, Prices);
title(app.UIAxes, 'Price');
axis(app.UIAxes, 'tight');
I have a hunch that the problem may be that "axis tight" does not find app.UIAxes, so instead you need to specify which axis you want to be tight. You do that by calling axis(<axis you want>, 'tight');
For more information, see: axis
Hope this helps!
  댓글 수: 1
Adam
Adam 2017년 8월 17일
Just as an additional note, you should get into the habit of doing this for all axes. I haven't used appdesigner much but if it forces you to specify explicit axes for operations that is a big step forward!

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

추가 답변 (1개)

Matt
Matt 2017년 8월 17일
Thanks Alex and Adam for your comments, this worked great!
axis(app.UIAxes, 'tight');

카테고리

Help CenterFile Exchange에서 Specifying Target for Graphics Output에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by