Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reversing one y-axis of a plotyy

Tags:

plot

matlab

My code:

figure
[ax, h1, h2] = plotyy(x1,y1,x2,y2,'semilogy','semilogy');

Now I want to reverse the direction of the second y-axis. I tried adding:

set(h2,'YDir','reverse');

But that results in the following error:

The name 'YDir' is not an accessible property for an instance of class 'lineseries'.
like image 789
Pietair Avatar asked Dec 21 '25 12:12

Pietair


1 Answers

Ydir is a writeable property of a axis, not of the graphics object:

set(ax(2),'YDir','reverse')
like image 109
Daniel Avatar answered Dec 23 '25 02:12

Daniel