[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: multiplot gnu under octave?
From: |
John Utz |
Subject: |
Re: multiplot gnu under octave? |
Date: |
Tue, 4 Apr 1995 00:54:40 -0700 (PDT) |
Hi;
thanks again for the subplot command. I seem to be having two
difficulties. The most important one is that i cant seem to use it to get
two plots on one gnuplot_x11 screen. i can get one half size plot in the
desired position, or i can get the other half size plot in the desired
position, but not both half size plots at the same time. Can you tell me
explicitly what commands i should type to achive this desired goal? I
thought i was doing it just like the help comments suggested. Could it be
that there is a gnuplot variable i need to set to tell gnuplot not to
clear the previous drawing when a new plot is invoked?
On Sun, 2 Apr 1995 address@hidden wrote:
... possibly too much important context deleted, but oh, well.
> Anyway here's my subplot.m for anyone who would like it:
> -------------------
> function subplot(mnp)
> % SUBPLOT Create axes in tiled positions.
> % SUBPLOT(m,n,p), or SUBPLOT(mnp), breaks the Figure window into
^^^^^
this syntax seems to unsupported in this file? at least i can't seem to
get it to work this way. i have to use the second one ( subplot ( 211 ))
> % an m-by-n matrix of small axes, selects the p-th axes for
> % for the current plot, and returns the axis handle. The axes
> % are counted along the top row of the Figure window, then the
> % second row, etc. For example,
> %
> % SUBPLOT(2,1,1), PLOT(income)
> % SUBPLOT(2,1,2), PLOT(outgo)
> %
> % plots income on the top half of the window and outgo on the
> % bottom half.
> %
> % SUBPLOT(m,n,p), if the axis already exists, makes it current.
> % SUBPLOT(H), where H is an axis handle, is another way of making
> % an axis current for subsequent plotting commands.
> %
> % If a SUBPLOT specification causes a new axis to overlap an
> % existing axis, the existing axis is deleted. For example,
> % the statement SUBPLOT(1,1,1) deletes all existing smaller
> % axes in the Figure window and creates a new full-figure axis.
>
> % Octave version by Rick Niles.
>
>
> m = fix(mnp/100);
> n = fix((mnp-100*m)/10);
> p = mnp-100*m-10*n;
> if (p > m*n)
> error('p must be less than m*n')
> end
>
> % This will make your margins a little better...
> vmore = (m-1)/5;
> hmore = (n-1)/20;
>
> col = p;
> row = 1;
> while (col > n)
> row = row + 1;
> col = col - n;
> end
>
> sc = sprintf("set size %f, %f", ...
> (1+hmore)*1/n,(1+vmore)*1/m);
> oc = sprintf("set orgin %f,%f", ...
> (1-hmore)*(col-1)/n,(1-hmore)*(m-row)/m);
>
> eval(sc)
> eval(oc)
>
> end
> ------------------------------
>
> Thanks,
> Rick Niles.
>
*******************************************************************************
John Utz address@hidden
idiocy is the impulse function in the convolution of life