MATLAB Answers

Thar
0

plot double y axis, 3 curves

Asked by Thar
on 9 Jul 2015
Latest activity Commented on by Thar
on 9 Jul 2015
Hi all!
I have the data:
x1=sza1(:,1);
y1=I1(:,1);
x2=sza2(:,1);
y2=I2(:,1);
y3=I3(:,1);
I want to plot: plot(x1,y1,'ob',x2,y2,'-or',x2,y3,'-ok');
but i want x2,y2, x2,y3 have different y axis from x1,y1.
Any ideas?
Thank you!

  0 Comments

Sign in to comment.

1 Answer

Answer by Azzi Abdelmalek
on 9 Jul 2015
Edited by Azzi Abdelmalek
on 9 Jul 2015
 Accepted Answer

If your data are column vector
[ax,h1,h2]=plotyy(x1,y1,x2,[y2 y3])
set(h1,'linestyle','none','marker','o','color','b')
set(h2(1),'linestyle','-','marker','o','color','r')
set(h2(2),'linestyle','-','marker','o','color','k')

  1 Comment

Thank you very much!!!

Sign in to comment.