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

Re: !P.MULTI + POSITION keyword problem




gpetty@rain.atms.purdue.edu (Grant W. Petty) writes:
> 
> I just learned about the !P.MULTI variable and wanted to use it to put
> multiple panels on a single postscript page.  The problem (I
> discovered after much head scratching) is that each of my panels use
> 'tv' and 'plot' calls which require the POSITION keyword for alignment
> (like David's 'imagebar' example in his book and for similar reasons).
> Unfortunately, the POSITION keyword causes IDL to disregard the
> contents of !P.MULTI (except for the first element).  I had hoped that
> POSITION would be defined in terms of "virtual" Normalized Device
> Coordinates for the current panel indicated by !P.MULTI, but this is
> apparently not the case.  Is there a simple way to get the desired
> effect without having to manually calculate new POSITION coordinates for
> each panel?
> 

I plot images quite a bit, and have developed a routine called
PLOTIMAGE which is available on my web site
(http://astrog.physics.wisc.edu/~craigm/idl/idl.html).  If you get it,
be sure to get PLOTIMAGE, TVIMAGE, CMCONGRID, and probably OPLOTIMAGE.
TVIMAGE is taken from David Fanning but slightly modified because
CONGRID does not produce correct output.  PLOTIMAGE et al are
documented with extensive comments.

It's pretty easy to use.  The following command will do the trick, as
long as the image is already byte-scaled:

IDL> PLOTIMAGE, img

Often you will want to assign coordinate axes to the image.  Do that
with the IMGXRANGE and IMGYRANGE which define the extent of the image.
You can display a subrange of the image quite naturally then by
specifying the XRANGE and YRANGE like you always would.  

PLOTIMAGE will respect the !p.multi settings, but these can be
overridden by the POSITION keyword.

You also mention virtual coordinates.  PLOTIMAGE can use virtual
coordinates.  It considers a "panel" to be the entire plotting region
including annotations, and the "subpanel" to be the actual plot data
window, specified in coordinates *relative* to the panel.  Coordinates
are fed in the same way as for POSITION, but with the PANEL and
SUBPANEL keywords.  I do have a program that tiles the page with
smaller panels if you'd like.  It helps remove the cavernous spacing
between plots under !P.MULTI too.

Cheers,
Craig

-- 
--------------------------------------------------------------------------
Craig B. Markwardt, Ph.D.         EMAIL: craigmnet@astrog.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
--------------------------------------------------------------------------