Add second y axis for a single data
이전 댓글 표시
I have a problem adding a second y-axis; all solutions point out that I need another data set to have a second y-axis. However, I want to have two y-axis for a single point while the x-axis is the same.
For instance;
point=(3,6), and I want to show that on the right y-axis side, the point (3,6) has a 0.5 value, so the general notation could be as (x,y1,y2)=(3,6,0.5)
first data
For example;
x=[3,5,6,8,11]
y1=[6,7,9,14,17]
I want right y axis to be
y2=[0.5,2,5,7,11]
.
댓글 수: 3
dpb
2022년 10월 27일
You can put a single point on the RH axis -- but plot or line won't show anything for a single point -- use scatter instead (or be sure to put a specific marker in the linestyle triplet location if do use plot).
But, it's not at all clear what you actually want here -- what's "point=(3,6), and I want to show that on the right y-axis side, the point (3,6) has a 0.5 value" really mean? The point (3,6) defines an x/y value on the two axes at that location; how can it then have the value of 0.5? And, then, what is the purpose/need of the y2 vector?
This is all very confusing as to actual intent.
Gunay Gazaloglu
2022년 10월 27일
편집: Gunay Gazaloglu
2022년 10월 27일
Torsten
2022년 10월 27일
I think what you need is plot3, not a second y-axis.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Axis Labels에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

