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

Re: !P.MULTI + POSITION keyword problem

Grant W. Petty wrote:
> 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?

Try using PLOT to establish your position coordinates.
You'll need http://www.dfanning.com/programs/tvimage.pro

;---cut here---

;- Set multiple plot options and make an image
!p.multi = [0,2,1,0,0]
image = bytscl( dist(32), top=!d.table_size-1 )
loadct, 0

;- Get plot position via PLOT
plot, [0], /nodata, xstyle=4, ystyle=4
position = [!x.window(0),!y.window(0),!x.window(1),!y.window(1)]

;- Display the image with title and axes
tvimage, image, /keep, position=position
plot, [0], /nodata, /noerase, position=position, title='Left Image'

;- Get next plot position
plot, [0], /nodata, xstyle=4, ystyle=4
position = [!x.window(0),!y.window(0),!x.window(1),!y.window(1)]

;- Display next image
tvimage, image, /keep, position=position
plot, [0], /nodata, /noerase, position=position, title='Right Image'

;---cut here---

Now when you turn on Postscript, everything should be positioned
correctly, e.g.

set_plot, 'PS'
device, /color, bits=8, /land
device, /close    ; now look at idl.ps


Liam E. Gumley
Space Science and Engineering Center, UW-Madison
1225 W. Dayton St., Madison WI 53706, USA
Phone (608) 265-5358, Fax (608) 262-5974