plot 2 curves with 'very close' y values

5 ビュー (過去 30 日間)
Sam Alex
Sam Alex 2012 年 12 月 22 日
Hello,
I would like to know if there is a way in matlab to plot 2 curves on the same plot, that have very close y values (very small differences).
Note: I have tried the 'log' for the y-scale but gave a similar view as the linear!
Thanks

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2012 年 12 月 22 日
編集済み: Azzi Abdelmalek 2012 年 12 月 22 日
plot(t,y1,'or)
hold on
plot(t,y2,'-g')
  17 件のコメント
Walter Roberson
Walter Roberson 2012 年 12 月 22 日
Okay, so they get similar and interleaved, and that is a problem because... ? And what would your output look like ideally?
Sam Alex
Sam Alex 2012 年 12 月 22 日
Thanks Azzi. You are an A++ expert!

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

その他の回答 (2 件)

José-Luis
José-Luis 2012 年 12 月 22 日
編集済み: José-Luis 2012 年 12 月 22 日
If you want to see the differences and at the same time keep values of your vectors, i would recommend something like this:
plot(x1d,x2d,'b-'); %your values
hold on;
plot([0 3],[0 3], 'k-'); % 1:1 line
So you have both your vectors in the x and y axes, and the diagonal line shows points of equal value. Below the diagonal one is greater than the other. Vice-versa for above. The further away, the larger the difference.
  6 件のコメント
Sam Alex
Sam Alex 2012 年 12 月 22 日
Thank you so much. You are wonderful!
José-Luis
José-Luis 2012 年 12 月 22 日
Not sure about that, but I'm glad I could help.

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


John D'Errico
John D'Errico 2012 年 12 月 22 日
So why not just plot the difference?
Or create two plots as a subplot, one with just curve 1, and the second as the difference between the two curves?
Or, have both plots on the same set of axes, with a double y axis?
help plotyy

カテゴリ

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