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

Home » Public Forums » archive » Postscript output
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Postscript Output [message #18734 is a reply to message #7108] Mon, 31 January 2000 00:00 Go to previous messageGo to previous message
Liam E. Gumley is currently offline  Liam E. Gumley
Messages: 378
Registered: January 2000
Senior Member
"Liam E. Gumley" wrote:

> uq9j wrote:
>
>> I'm trying to export the contents of an IDL graphics window to a
>> postscript file. This is the IDL code I've been using so far in a
>> subroutine:
>>
>> set_plot,'PS'
>>
>> device, /color, file='file.ps'
>>
>> tv,image ;the variable image contains the pixel raster to store
>>
>> device, /close
>>
>> A postscript file is generated, however, the page is empty.
>> What is wrong? Who can help me?
>
> When TV is used to display an image on the Postscript device, you must
> use the XSIZE and YSIZE keywords to specify the image size.
>
> However I think you'll find it much easier to grab my IMDISP program
> from
> http://cimss.ssec.wisc.edu/~gumley/imdisp.html
>
> and try the following:
>
> entry_device = !d.name
> set_plot, 'PS'
> device, /color, bits=8, file='image.ps'
> imdisp, image
> device, /close
>
> Note the use of the BITS keyword. I think you'll find IMDISP much easier
> to use in graphics windows as well, e.g.
>
> set_plot, entry_device
> imdisp, image
>
> Cheers,
> Liam.
> http://cimss.ssec.wisc.edu/~gumley

As David correctly points out, if you don't see an image, it probably
wasn't byte-scaled correctly. Fortunately, IMDISP automatically byte scales
the image.

One more thing: If your graphics display is running in 8-bit mode, then
make sure you load the appropriate color table *after* you switch to
Postscript mode. In 8-bit mode, the size of the color table might be 175.
So if you load the grayscale color table, it is loaded with 175 levels. In
Postscript mode, the color table size is always 256, so you need to re-load
the color table: Immediately before the TV (or IMDISP) command is the best
place to do it:

table = 0
entry_device = !d.name
set_plot, 'PS'
device, /color, bits=8, file='image.ps'
loadct, table
imdisp, image
device, /close
set_plot, entry_device

If you are running IDL in 24-bit mode, then you don't have to worry,
because the color table size is always 256, no matter which graphics device
is selected.

Cheers,
Liam.
http://cimss.ssec.wisc.edu/~gumley
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Postscript output device
Next Topic: re: Should IDL throw a warning in this case?

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

Current Time: Fri Oct 10 14:28:47 PDT 2025

Total time taken to generate the page: 2.47978 seconds