Pietair
Pietair

Reputation: 406

Reversing one y-axis of a plotyy

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'.

Upvotes: 3

Views: 931

Answers (1)

Daniel
Daniel

Reputation: 36720

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

set(ax(2),'YDir','reverse')

Upvotes: 4

Related Questions