Why does my plot shrink?
10 次查看(过去 30 天)
显示 更早的评论
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 个评论
Chunru
2024-2-28
You may want to try the following (or combinations of them):
axis(ax, "ij")
axis(ax, "normal")
采纳的回答
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Mathematics and Optimization 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!