Mac display help [message #16883] |
Thu, 26 August 1999 00:00  |
bcohen
Messages: 15 Registered: January 1996
|
Junior Member |
|
|
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 Cohen]
bcohen@lpl.arizona.edu
--
|
|
|
Re: Mac display help [message #16884 is a reply to message #16883] |
Wed, 25 August 1999 00:00   |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Barbara A Cohen (bcohen@lpl.arizona.edu) writes:
> 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?
Uh, normalized coordinates. All the time. Every time. Every where. :-)
Cheers,
David
P.S. Lot's of good tips about PostScript output in the
Producing Perfect PostScript Output section of my IDL
Tips page:
http://www.dfanning.com/documents/tips.html
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
Re: Mac display help [message #16885 is a reply to message #16883] |
Wed, 25 August 1999 00:00   |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Barbara A Cohen (bcohen@lpl.arizona.edu) writes:
> 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?
Uh, normalized coordinates. All the time. Every time. Every where. :-)
Cheers,
David
P.S. Lot's of good tips about PostScript output in the
Producing Perfect PostScript Output section of my IDL
Tips page:
http://www.dfanning.com/documents/tips.html
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
Re: Mac display help [message #16947 is a reply to message #16883] |
Fri, 27 August 1999 00:00  |
m218003
Messages: 56 Registered: August 1999
|
Member |
|
|
Hell! I am just trying to make IDL popular among my colleagues over here:
;- Create window with portrait aspect
device, get_screen_size=screen_size
ysize = screen[1] - 100
xsize = long(ysize * (21./29.7)) ; <--------
window, /free, xsize=xsize, ysize=ysize
;- Create window with landscape aspect
device, get_screen_size=screen_size
xsize = screen[1] - 100
ysize = long(xsize * (21./29.7)) ; <--------
window, /free, xsize=xsize, ysize=ysize
;- To set the vector fonts to an appropriate size
device, set_character_size=[10, 12]
To set up Postscript portrait and landscape mode pages:
;- Portrait mode on A4 page with 2 cm margin <------
device, /inches, xsize=21./2.54, ysize=29.7/2.54, xoffset=2./2.54, $
yoffset=2./2.54
;- Landscape mode on A4 page with 2 cm margin <------
device, /inches, xsize=29.7/2.54, ysize=21./2.54, xoffset=2./2.54, $
yoffset=(29.7-2.)/2.54
If you then use normalized coordinates and/or !p.multi for positioning, your
Postscript output should look just about the same as it does in a graphics
window.
But otherwise: Thanks a lot for this, Liam!!
Martin
--
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
[[ Martin Schultz Max-Planck-Institut fuer Meteorologie [[
[[ Bundesstr. 55, 20146 Hamburg [[
[[ phone: +49 40 41173-308 [[
[[ fax: +49 40 441787 [[
[[ martin.schultz@dkrz.de [[
[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ [[[[[[[
|
|
|
Re: Mac display help [message #16964 is a reply to message #16883] |
Thu, 26 August 1999 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Liam Gumley (Liam.Gumley@ssec.wisc.edu) writes:
> To create a graphics window with the same aspect as a portrait or landscape
> page:
Liam supplies some good advice here.
I tend to work the other way around. I want my
PostScript "window" to have the same aspect ratio
as the current graphics window. I do this:
keywords = PSWindow()
Set_Plot, 'PS'
Device, _Extra=keywords
And I am ready to go.
You can find the PSWINDOW program on my web page:
http://www.dfanning.com/programs/pswindow.pro
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|
Re: Mac display help [message #16965 is a reply to message #16883] |
Thu, 26 August 1999 00:00  |
Liam Gumley
Messages: 473 Registered: November 1994
|
Senior Member |
|
|
To create a graphics window with the same aspect as a portrait or landscape
page:
;- Create window with portrait aspect
device, get_screen_size=screen_size
ysize = screen[1] - 100
xsize = long(ysize * (8.5 / 11.0))
window, /free, xsize=xsize, ysize=ysize
;- Create window with landscape aspect
device, get_screen_size=screen_size
xsize = screen[1] - 100
ysize = long(xsize * (8.5 / 11.0))
window, /free, xsize=xsize, ysize=ysize
;- To set the vector fonts to an appropriate size
device, set_character_size=[10, 12]
To set up Postscript portrait and landscape mode pages:
;- Portrait mode on 8.5 x 11 in. page with 0.75 in. margin
device, /inches, xsize=7.0, ysize=9.5, xoffset=0.75, yoffset=0.75
;- Landscape mode on 11 x 8.5 in. page with 0.75 in. margin
device, /inches, xsize=9.5, ysize=7.0, xoffset=0.75, yoffset=10.25
If you then use normalized coordinates and/or !p.multi for positioning, your
Postscript output should look just about the same as it does in a graphics
window.
Cheers,
Liam.
--
Liam E. Gumley
Space Science and Engineering Center, UW-Madison
http://cimss.ssec.wisc.edu/~gumley
|
|
|
|
Re: Mac display help [message #16976 is a reply to message #16883] |
Thu, 26 August 1999 00:00  |
Liam Gumley
Messages: 473 Registered: November 1994
|
Senior Member |
|
|
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
|
|
|