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

Re: Mac display help



Barbara A Cohen wrote:
> Hi, I have been using idl for about a year on a UNIX system, where I output
> everything to a postscript file, looked at the postscript, and made
> adjustments as necessary to xyouts, etc.  I have just gotten idl for
> my Mac and of course can't do things that way.  I tried installing
> GhostScript but it makes my computer crash every time. What I'd like
> to do is have a display window that at least positions everything the way
> it will come out when I write to postscript.  As it is now, the positions
> and thicknesses are all weird.  I'm sorry if this is an old question
> but does anyone know how to deal with the Mac display windows? Thanks
> in advance for anyone's suggestions...

Barbara,

David's previous comments about normalized coordinates are very
important. What he means is that everything on your display should be
positioned using normalized coordinates, not pixel coordinates. Another
tip is to create a display window which has the same aspect as a printed
page. The following example shows how to do this for Landscape output.
Start a new IDL session, and try the following:

;- Create a graphics window with the same aspect as a landscape page
device, true=24, decomposed=0, retain=2
window, /free, xsize=924, ysize=714
device, set_character_size=[10, 12]

;- Display a surface plot and label
loadct, 0
shade_surf, dist(32), position=[0.2, 0.2, 0.5, 0.5], charsize=2
xyouts, 0.75, 0.75, 'IDL Surface Plot', /normal, align=0.5, charsize=2

;- Change to Postscript landscape mode
set_plot, 'PS'
device, /landscape, /color, bits=8

;- Display a surface plot and label
loadct, 0
shade_surf, dist(32), position=[0.2, 0.2, 0.5, 0.5], charsize=2
xyouts, 0.75, 0.75, 'IDL Surface Plot', /normal, align=0.5, charsize=2

;- Close the Postscript file
device, /close

You should see that the Postscript output looks very similar to the
display window. Note how the POSITION keyword was used to position the
surface plot using normal coordinates, which start at 0.0,0.0 at the
bottom left, and end at 1.0,1.0 at upper right. For more information,
type 

? normal coordinates

at the IDL command line.

Cheers,
Liam.
PS: *And* check out David's tips for perfect Postscript output.

-- 
Liam E. Gumley
Space Science and Engineering Center, UW-Madison
http://cimss.ssec.wisc.edu/~gumley