scatter with 2 y axis

Hello everyone, I would like your help! I have the attached plot and I have to insert a second yaxis because for each 'Rb-sec' point there is one more value that is relative with that set (i.e if X=64.39 and Y=0.022 then there is a YY=8265). I tried with plotyy but the arguments were too many. I tried to add the second y (YY) manually but it is some kind of "inactive" (meaning that the points in the plot don't have the 3 values (x,y, yy)). I have to mention that I might use "plot" but actually, I need a scatter plot. The code to add the yy manually is :
plot(x1,y1,'ro', x2,y2,'ko',x3,y3,'bo',x4,y4,'yo')
yy = axes('YAxisLocation', 'Right')
legend('test1_ 2017-12','test2_ 2017-05','test3_ 2017-04','test4_ 2016-08')
xlabel('sec')
ylabel('Rb')
set(yy, 'color', 'none')
set(yy, 'XTick', [])
set(yy, 'YLim', [8150 10500])
Thank you in advance!

4 件のコメント

jonas
jonas 2018 年 9 月 18 日
編集済み: jonas 2018 年 9 月 18 日
Disregard my last (now deleted) comment. I had another file named test.fig in my search path. I still don't understand what you are trying to achieve though, you want each point to be connected to three values? In a 2D plot? Perhaps you are looking for scatter3?
Nivodi
Nivodi 2018 年 9 月 18 日
I think that can't be plotted....I am trying to understand if 'sec' affects the "rb' value. I apologize Jonas for wasting your time..
jonas
jonas 2018 年 9 月 18 日
編集済み: jonas 2018 年 9 月 18 日
No need to apologize! I am here to help. I would have a look at scatter and scatter3. Both functions allow variable markersize and color to describe the 3rd value (3rd dimension) in each point.
Nivodi
Nivodi 2018 年 9 月 18 日
Thank you very much Jonas.

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

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCreating and Concatenating Matrices についてさらに検索

質問済み:

2018 年 9 月 18 日

コメント済み:

2018 年 9 月 18 日

Community Treasure Hunt

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

Start Hunting!

Translated by