フィルターのクリア

using the figure command only once. — somehow the subplot appears afterwards.

1 回表示 (過去 30 日間)
Julian Behrens
Julian Behrens 2018 年 11 月 23 日
編集済み: Cris LaPierre 2018 年 11 月 23 日
I wrote code to create a figure with 2 subplots.
when I then use a boxplot command after that, one subplot from above appears again and on the right next to it appears the wanted plot.
I can forego this issue by using another
figure;
%%my plot
command afterwards. however, I do not fully understand the 'mechanics' behind that, which is why I want to ask what is going on. Why can i not plot as usual without creating a figure? (When I plot as usual wihtout creating a figure this subplot-appearing-again-issue occurs).
Thank you

採用された回答

Cris LaPierre
Cris LaPierre 2018 年 11 月 23 日
編集済み: Cris LaPierre 2018 年 11 月 23 日
Could you clarify if you are using a live script or not?
By default, plot commands will plot onto the current axes (last plot created/interacted with). It will only create a new figure if there is no current axes. If the previous figure has a suplot, then the next plot command will replace the last subplot plot.
The way around this is to use the figure command to create a new blank axes before plotting.

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by