Why does my plot shrink?
11 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi,
I was wondering if any may be able to help? My plot keeps shrinking when the FOR loop has finished.
It should look like this,
and does whilst it is updated from the FOR loop, but as soon as the loop has finished it looks like this
The code for the imagesc plot is as follows:
within the app
% Define axis to plot
axis(app.UIAxes,'image');
app.ax = app.UIAxes;
% Call function FDTD
[app.E2,app.V2] = fdtd_time_reversal(app.X, app.Y, app.del, app.dt, app.send, app.arraystart, app.elements, app.receiver , 1, 1, -app.depth, app.offset + app.depth, app.media, app.er, app.ax);
imagesc(app.UIAxes,app.E2)
axis(app.UIAxes, 'image')
xlim(app.UIAxes, 'tight')
ylim(app.UIAxes, 'tight')
drawnow
and within the function, where a call is made to another function first.
% Advance the fields using code 'fdtd_andy'
[ezx,ezy,hx,hy] = fdtd_andy(ezx,ezy,hx,hy,alphaex,alphaey,alphamx,alphamy,betaex,betaey,betamx,betamy);
%The extra layers from the boundary conditions are removed
E=(ezx+ezy);
[a,b] = size(E);
E = E(33:(a-32), 33:(b-32));
E1=E;
E2=E;
colormap(ax, jet)
% mesh(ax, E)
imagesc(ax, E)
caxis(ax, [-100 100])
axis(ax,'image')
xlim(ax, 'tight')
ylim(ax, 'tight')
drawnow % This command will tell MATLAB to draw this frame before moving on
Hoping someone may know.
Kind regards,
Andy
1 Kommentar
Chunru
am 28 Feb. 2024
You may want to try the following (or combinations of them):
axis(ax, "ij")
axis(ax, "normal")
Akzeptierte Antwort
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Mathematics and Optimization finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!