comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: OK, I'm stumped
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: OK, I'm stumped [message #11989] Sat, 20 June 1998 00:00
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
William H Dorin IV (bill4@lanl.gov) writes:

> I'm rather new to IDL, and have been having trouble with what is
> probably a trivial question (I have, however, read the faq, help files,
> and class manual). The problem is as follows:
>
> I have a proceedure which reads in a 180*360 array of data and creates a
> nice color contour plot, then plots a few points and some text (with
> underwritten white test for visibility), then plots it to a XWindows
> screen, and saves it to a gif file. My problem is that I cannot seem to
> figure out how to save this file to a postscript format.
>
> I've been using XV to port each gif to ps, so I can print these
> plots on the color postscript printer we have, but this is becoming an
> unsatisfactory method.
> So, I modified my code as follows:
>
> Set_plot, 'PS'
> Device, /color, file='my_plot.ps'
>
> map_set
> contour, my data
> xyouts, 'text' (several of these)
> plots, some points
>
> set_plot, 'X'
>
> This generates an unreadable file.

Not unreadable. Just one that doesn't print. Primarily
because you forgot to close the file, which it what puts
the PostScript showpage command into the file. This is the
command that ejects the page from the printer. Your file
likely processes, just never shows up in the output tray. :-)

You are also going to be 16 colors with this code and my
guess is you expect at least 256 colors. The correct sequence
of commands would look something like this:

thisDevice = !D.Name
Set_Plot, 'PS'
Device, Color=1, Bits_Per_Pixel=8, File='my_plot.ps'

Map_Set
Contour, my_data
XYOuts, 'text' ... (You use NORMAL coordinates, right?)
PLOTS, ....

Device, /CLOSE_FILE
Set_Plot, thisDevice


> Furthermore, the online help
> is pretty bad in regard to this sort of thing.

Have a look at the series of articles on my web page,
which collectively are entitled "How to Get Perfect
PostScript Output in IDL".

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438
Coyote's Guide to IDL Programming: http://www.dfanning.com/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: To found the size(area) of a certain domain.
Next Topic: Re: middle mouse button???

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Oct 12 14:16:30 PDT 2025

Total time taken to generate the page: 1.51840 seconds