[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Subplots--Touching Each Other

From: bpabbott
Subject: Re: Subplots--Touching Each Other
Date: Thu, 14 Apr 2011 20:58:48 +0000 (GMT)

On Apr 14, 2011, at 04:42 PM, Martin Senator <address@hidden> wrote:

I would like to plot two graphs side by side;
they have the same y scale and different x scales.
I would like the boxes around the plots to touch
on the common y axis, with no ylabel or numbers
printed on the rightmost plot.
How do I do this?

To get the effect you want, you can create two axes and set their positions. For example, ...

figure (1)
x = 0:0.01:10;
h1 = axes ();
h2 = axes ();
p1 = p2 = get (h1, "position");
p1(3) = p2(3) = p1(3) / 2;
p2(1) = p2(1) + p1(3);
axes (h1)
plot (x, sin(x))
xlabel ("radians")
ylabel sin(x)
axes (h2)
plot (x*180/pi, sin(x))
xlabel ("degrees")
set (h1, "position", p1);
set (h2, "position", p2, "ytick", []);


reply via email to

[Prev in Thread] Current Thread [Next in Thread]