How can i merge several subplot in one figure

19 ビュー (過去 30 日間)
Niloufar Baba adam
Niloufar Baba adam 2020 年 10 月 31 日
編集済み: Adam Danz 2020 年 11 月 19 日
Hi every one
I have several subplots like :
and i want to merge them such as:
could anyone help me to do that?
Thank you so much.

採用された回答

Adam Danz
Adam Danz 2020 年 10 月 31 日
編集済み: Adam Danz 2020 年 11 月 19 日
It looks like you might be using a stackedplot which currently doesn't support adding objects to the axes after the plot is created. You can, however, plot multiple lines in each axis (see this answer).
Subplots and tiledlayouts do allow adding objects to the axes.
Option 1:
  • use hold(ax,'on') to hold the axes 'ax'.
  • use plot(ax,____) to plot on axes 'ax'
Option 2:
  • Copy a plotted line 'h' to axes 'ax' using copyobj(h,ax)
  5 件のコメント
Niloufar Baba adam
Niloufar Baba adam 2020 年 11 月 2 日
unfortunantly I'm not very good at programming, Thank you if you can help me
Adam Danz
Adam Danz 2020 年 11 月 2 日
The phrase "it's not working" doesn't convey much information.
axHand.Title.String - should be a string that matches the axis title (assuming the axis has a title).
h.DisplayName = axHand.Title.String; - should assign the axis title as the line object's DisplayName (which will appear in the legend).
When you use the DisplayName property (which is a good idea), you don't need to re-define the legend strings when you call legend().
This line
legend(newAxes,'original response','the effects of H3,5', 'the effect of H3','the effect of H5')
should just be
legend(newAxes)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeTitle についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by