How to position the y axis on the right in a plot

7 views (last 30 days)
I have two vectors f(t) and g(t) and I want to plot them in one graph using plotyy. But I also want to do some other things like changing the marker style of each curve and also changing the span of the axes. I have tried using xlim but it only affects one of the x axes, not both.

Accepted Answer

Ingrid on 28 Jan 2016
you need to use the handles for this so
[hAx,hLine1,hLine2] = plotyy(x,y1,x,y2);
this is also very well explained in the documentation of plotyy
doc plotyy
Ingrid on 29 Jan 2016
this is clearly explained in the documentation of plot

Sign in to comment.

More Answers (0)


Find more on Two y-axis in Help Center and File Exchange


Community Treasure Hunt

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

Start Hunting!