App designer is resizing my UIAxes when they are plotted.

조회 수: 3 (최근 30일)
Joshua Mitchell
Joshua Mitchell 2021년 3월 1일
댓글: Allen 2021년 3월 1일
Hi, I am designing an app with multiple Axes, I'm nearly finished and all of a sudden Matlab is re-sizing my Axes every time they are plotted. I'm not sure why this is happening now. I want the plots to have the same size no matter the input, and each axis within each plot to have equal size (1:1:1 ratio).
I have tried this code, the last two lines being my attempt at fixing this issue:
% Button pushed function: PlotNewDipoleButton
function PlotNewDipoleButtonPushed(app, event)
% update 2D and 3D plots with user-specific information for
% potential survey areas
[Bat]=mvf_plane([app.minc,app.mdec,app.m],app.Ba_mag,app.Ba_inc,app.Ba_dec,30,1,app.alt);
surf(app.UIAxes2,Bat);
ylim(app.UIAxes2, [0 60]);
xlim(app.UIAxes2, [0 60]);
view(app.UIAxes2,2);
surf(app.UIAxes3,Bat);
ylim(app.UIAxes3, [0 60]);
xlim(app.UIAxes3, [0 60]);
view(app.UIAxes3,3);
ztickformat(app.UIAxes3,'%g');
app.UIAxes3.PlotBoxAspectRatio = [1 1 1];
app.UIAxes3.PlotBoxAspectRatioMode = 'manual';
Here are the plots:
You can see they are being stretched out further than the app borders. If I chnage some of the inputs:
Any help is appreciated, thanks.
  댓글 수: 1
Allen
Allen 2021년 3월 1일
Joshua,
Do the axes position properties change at all? From your screenshots, it appears like that might be occurring. Either way it looks like this may be bug in MATLAB that needs to be reported.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by