How can I set different intervals of y axes limits for the same curve?

7 ビュー (過去 30 日間)
Marcello
Marcello 2014 年 7 月 22 日
回答済み: li jiaxing 2017 年 6 月 27 日
I have the following set of data:
x=[1:10];
y=[1:8, 90 92];
I want to plot (x,y) in order to highlight both the variability within 0 and 10, and the variability within 85 and 95. I would need to draw two intervals of the y axis on the same plot, such as ylim([0 10]...[85 95]), but it doesn't seem to be possible. Any help?

採用された回答

Namita Vishnubhotla
Namita Vishnubhotla 2014 年 7 月 22 日
You can use the “BreakPlot” function to plot data that span two distinct ranges of your dependent variable. The function allows you to break the y-axis to reflect the different ranges.
Follow this link for a File Exchange article on BreakPlot:
  1 件のコメント
Marcello
Marcello 2014 年 7 月 23 日
Thanks Namita, very useful. But what if I have y=[1:8, 1000 2000]? I would have to set up two different scales for the yaxis. One that goes from 0:10 and another that goes, say, 1000:500:2000, so that the variability between 0 and 10 is still visible...but BreakPlot doesn't let me do that... Do you know a solution for this further issue?

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

その他の回答 (1 件)

li jiaxing
li jiaxing 2017 年 6 月 27 日
Did you solve your problem? I have this problem now and I get the figure using Originlab software. But I want to solve it in matlab, can you help me?

カテゴリ

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