Connect scatter line in multiple y axis

1 回表示 (過去 30 日間)
Matt
Matt 2014 年 9 月 19 日
コメント済み: Matt 2014 年 9 月 19 日
I have two y axis and one x axis plot.
x=[0.8,1.3,2.2,2.9,3.6];
y1=[17.22,18.9,19.74756674,21.64790459,22.77216041];
y2=[0.07,0.11,0.163,0.27,0.29];
[ax, h1, h2] = plotyy(x,y1,x,y2,'scatter');
line(x,y1)
set(ax(1),'ycolor','r')
set(ax(2),'ycolor','b')
It connected the first scatter lines. But i cant conned the second scatter lines. Please help?

採用された回答

per isakson
per isakson 2014 年 9 月 19 日
編集済み: per isakson 2014 年 9 月 19 日
Add this line to the code
line( x, y2, 'Parent', ax(2) )
plotyy adds two axes on top of each other with ax(2) on top. Don't ask me why, but this line of code seems to add a visible line object. (I look forward to HG2.)
  2 件のコメント
Matt
Matt 2014 年 9 月 19 日
Thank you very much
Matt
Matt 2014 年 9 月 19 日
how can I Choose scatter types like +, * or diamond in my plot

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

その他の回答 (0 件)

カテゴリ

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