Why does my plot shrink?
11 ビュー (過去 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!