help-octave
[Top][All Lists]

## Re: Lining up the axes of multiplots/subplots

 From: Ron Crummett Subject: Re: Lining up the axes of multiplots/subplots Date: Fri, 17 Nov 2006 07:04:10 -0800 User-agent: Thunderbird 1.5.0.8 (X11/20061025)

```How about

axis([xmin xmax ymin ymax])

```
on each subplot? Just call it after each subplot. You can use this to align both x- and y-axes as you want. As far as plotting both plots in one window with one x-axis and different y-axes, Matlab has a plotyy command to do this. To my knowledge Octave does not yet have this but I am in the process of putting something similar together.
```
-Ron

Joseph Wakeling wrote:
```
```Hello,

I'm hoping someone can give me some advice on multiplot(), subplot() and
related commands.  I've played around with them a bit but not had
success in achieving what I want.

Here's the aim: two plots, one above the other, sharing the same X
scale.  The X axes must line up together.

I want to plot several data sets in the first plot, and some different
ones in the second.

Now, I can do ...

#first
subplot(2,1,1)
plot(x1,y1)
hold on
plot(x2,y2)
#etc
hold off

#then
subplot(2,1,2)
plot(a1,b1)
hold on
plot(a2,b2)
#etc
hold off

... to get the plots one above the other, but this doesn't do anything
to align the axes.  What commands do I have to use to achieve this?

Two related issues would be (a) the same, but side-by-side and sharing
the same Y scale, and (b) overplotted graphs, where e.g. the X scale is
the same but there are two different Y scales on the left and right Y axes.

Many thanks,

-- Joe
_______________________________________________
Help-octave mailing list
```