how to plot two y axes with different zeros?

2 ビュー (過去 30 日間)
Lilya
Lilya 2020 年 5 月 13 日
コメント済み: Lilya 2020 年 5 月 13 日
Hi all
I want to have a plot similar to the attached figure.
It should have 2 y-axes, but the right one is shifted in position instead of having it from the original zero
the x-axis is the same.
Could anyone help?
Much appreciated.
  6 件のコメント
dpb
dpb 2020 年 5 月 13 日
Be a little creative...try
yyaxis right
ylim([-20 20])
yt=yticks;
yticks(yt(yt>=0))
and see what you get...
Lilya
Lilya 2020 年 5 月 13 日
Thanks a bunch!! it works.

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

回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by