How can I divide the plot to the two levels (upper and lower) with different y range data?

2 ビュー (過去 30 日間)
Riyadh Muttaleb
Riyadh Muttaleb 2017 年 1 月 13 日
コメント済み: Riyadh Muttaleb 2017 年 1 月 16 日
Hi All,
I would to like to plot as in the figure below, different y levels with different y ranges with the same x axis.
Thanks in advance,
Riyadh

回答 (2 件)

Image Analyst
Image Analyst 2017 年 1 月 15 日
編集済み: Image Analyst 2017 年 1 月 15 日

Adam
Adam 2017 年 1 月 13 日
編集済み: Adam 2017 年 1 月 13 日
doc yyaxis
if you are using R2016a or later.
doc plotyy
if not. With these you can define the left and right axes and use ylim on each to change where your data sits. Whether you can achieve the plot you have there I'm not sure though. I've never needed to use these myself so I'm not too familiar with how far you can manipulate them.
You could just do it with 2 axes that you manually position to be immediately above/below each other and remove all x ticks from the top one and then use
doc linkaxes
to link the x limits of the two axes so they zoom together etc.
  2 件のコメント
Riyadh Muttaleb
Riyadh Muttaleb 2017 年 1 月 14 日
Thank you for your response. my question how can plot figure with * two different y scales* as in the fig.
Adam
Adam 2017 年 1 月 15 日
That is what yyaxis and plotyy do. Whether they do it like the picture or not is debatable, but you can't perfectly recreate a plot from somewhere totally different.

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

カテゴリ

Help Center および File ExchangeTwo y-axis についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by