Dummy y axis?
이전 댓글 표시
Hi, I have data as bellow
x = [ 0 1 2 3 4 5 6 7 8 9 10]
V= [0 2 4 6 8 10 12 14 16 18 20]
I=V/0.5;
I wan to plot (x,V), and (x,I) on the same plot, now since both v and I carry same information all I want is to plot only (x,V) and show another Y axis on right corresponding to I.
Think of it as if you plot a variable say pressure (P) with tepmerature (t), plot (t,P) but you want two Y axis representing pressure in two different units say. mbar and torr. Am I able to explain myself?
채택된 답변
추가 답변 (1개)
madhan ravi
2019년 1월 30일
doc yyaxis
댓글 수: 8
madhan ravi
2019년 1월 30일
doc plotyy % for older version of matlab
Samir
2019년 1월 30일
madhan ravi
2019년 1월 30일
편집: madhan ravi
2019년 1월 30일
First try the solutions suggested and then come back without trying you are wasting your time and others as well upload a sample picture of the desired graph so that it's clear what you are trying to do!
Does the below do what you want if not I have no idea what you want :
yyaxis left
plot(x,V)
ylabel('V')
yyaxis right
ylabel('I')
Samir
2019년 1월 30일
Samir
2019년 1월 30일
madhan ravi
2019년 1월 30일
yyaxis left
plot(x,V)
ylim([0 10])
yticks(0:2:10)
xlabel('x')
ylabel('V')
yyaxis right
xlabel('x')
ylabel('I')
ylim([0 20])
yticks(4:4:20)
카테고리
도움말 센터 및 File Exchange에서 Axis Labels에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
