Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
plotyy

Subject: plotyy

From: J G

Date: 30 Sep, 2010 23:28:05

Message: 1 of 2

When plotting a plot with two y-axis (plotyy), how do you set the axis scale of the second y axis? I want it to range from 1 to 2.

x = [0.1 0.25 0.5 0.75 0.9];
y1 = [0.69 0.65 0.65 0.58 0.45; 0.31 0.35 0.35 0.4 0.48; 0 0 0.0007 0.007 0.07; 0 0 0 0 0.002];
y2 = [1.31 1.35 1.3521 1.421 1.628];

[AX,H1,H2] = plotyy(x,y1,x,y2);

Thanks.

Subject: plotyy

From: Ross W

Date: 1 Oct, 2010 00:33:24

Message: 2 of 2

"J G" <jemma.geoghegan@gmail.com> wrote in message <i836e5$1or$1@fred.mathworks.com>...
> When plotting a plot with two y-axis (plotyy), how do you set the axis scale of the second y axis? I want it to range from 1 to 2.
>
> x = [0.1 0.25 0.5 0.75 0.9];
> y1 = [0.69 0.65 0.65 0.58 0.45; 0.31 0.35 0.35 0.4 0.48; 0 0 0.0007 0.007 0.07; 0 0 0 0 0.002];
> y2 = [1.31 1.35 1.3521 1.421 1.628];
>
> [AX,H1,H2] = plotyy(x,y1,x,y2);
>
> Thanks.

Did you try this:
ylim(AX(2),[1 2])

Ross

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us