Filter löschen
Filter löschen

App designer is resizing my UIAxes when they are plotted.

4 Ansichten (letzte 30 Tage)
Joshua Mitchell
Joshua Mitchell am 1 Mär. 2021
Kommentiert: Allen am 1 Mär. 2021
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 Kommentar
Allen
Allen am 1 Mär. 2021
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.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Produkte


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by