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 Center および File Exchange2-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