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 
Switch to threaded view of this topic Create a new topic Submit Reply
Postscript output [message #7108] Wed, 02 October 1996 00:00 Go to next message
Richard Townsend is currently offline  Richard Townsend
Messages: 1
Registered: October 1996
Junior Member
I have a problem with postscript output that I'm hoping someone will be
able to help me with. I have some IDL arrays of dimension N x N which are
latitude/longitude maps of some function (a spherical harmonic) over the
surface of a sphere. I want to display these maps wrapped over the sphere
in an orthographic projection. The commands I am using are something of
the form:

set_plot,'ps'
device,/encapsulated,bits_per_pixel=8,xsize=5,ysize=5,/inche s

!p.multi=[0,2,2]

map_set,/orthographic,/noborder,/advance,/isotropic,45,0
mapped=map_patch(bytscl(array1),xstart=x0,ystart=y0, $
xsize=xs,ysize=ys,missing=255)
tv,k,x0,y0,xsize=xs,ysize=ys
map_grid,color=255

map_set,/orthographic,/noborder,/advance,/isotropic,45,0
mapped=map_patch(bytscl(array2),xstart=x0,ystart=y0, $
xsize=xs,ysize=ys,missing=255)
tv,mapped,x0,y0,xsize=xs,ysize=ys
map_grid,color=255

map_set,/orthographic,/noborder,/advance,/isotropic,45,0
mapped=map_patch(bytscl(array3),xstart=x0,ystart=y0, $
xsize=xs,ysize=ys,missing=255)
tv,mapped,x0,y0,xsize=xs,ysize=ys
map_grid,color=255

map_set,/orthographic,/noborder,/advance,/isotropic,45,0
mapped=map_patch(bytscl(array4),xstart=x0,ystart=y0, $
xsize=xs,ysize=ys,missing=255)
tv,mapped,x0,y0,xsize=xs,ysize=ys
map_grid,color=255

device,/close


...where array1-array4 are the data arrays (as you can see, I want to
plot four separate arrays). My problem is that the boundaries of the
globes which I plot are very jagged, and increasing the size N of the
arrays does not cure this. How can I increase the postscript resolution
and get rid of the jagged edges?

Thanks in advance,

Rich

+-------------------------------------+--------------------+
| Richard Townsend | |
| Department of Physics & Astrononmy | "Old pond, |
| University College London | frog jumps in - |
| Gower Street | plop" |
| London WC1E 6BT | |
| (0171) 419 3410 | Basho |
+-------------------------------------+--------------------+
Re: Postscript output [message #7185 is a reply to message #7108] Sat, 05 October 1996 00:00 Go to previous messageGo to next message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Richard Townsend <rhdt@star.ucl.ac.uk> writes:

> I have a problem with postscript output that I'm hoping someone will be
> able to help me with. I have some IDL arrays of dimension N x N which are
> latitude/longitude maps of some function (a spherical harmonic) over the
> surface of a sphere. I want to display these maps wrapped over the sphere
> in an orthographic projection. The commands I am using are something of
> the form:
>
> map_set,/orthographic,/noborder,/advance,/isotropic,45,0
> mapped=map_patch(bytscl(array1),xstart=x0,ystart=y0, $
> xsize=xs,ysize=ys,missing=255)
> tv,k,x0,y0,xsize=xs,ysize=ys

> My problem is that the boundaries of the
> globes which I plot are very jagged, and increasing the size N of the
> arrays does not cure this. How can I increase the postscript resolution
> and get rid of the jagged edges?

I am not sure how to get rid of the jaggies with the routine MAP_PATCH.
But if you can use the MAP_IMAGE routine instead, you can increase the
smoothness of the edges by setting the COMPRESS keyword equal to 1.
This will solve the inverse map transformation for each pixel in the
output image and will improve the result dramatically for PostScript
output.

David

--
David Fanning, Ph.D.
Phone: 970-221-0438
Fax: 970-221-4728
E-Mail: davidf@fortnet.org
Re: Postscript output [message #14876 is a reply to message #7108] Fri, 02 April 1999 00:00 Go to previous messageGo to next message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Waleed (114566.43@CompuServe.COM) writes:

> Hi. There's seems to be a lot of software out there that claims
> to render decent postscript. Can anyone suggest a particular one
> that does the job with minimum fiddling?

Uh, I use IDL. :-)

> Also, I often need postscipt output from images copied from the Z
> buffer. Is there a specific way to do that?

This must be a trick question. I'm going back to my damn book
and let Phil have a go at this one. :-(

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: Postscript Output [message #18731 is a reply to message #7108] Mon, 31 January 2000 00:00 Go to previous messageGo to next message
Liam E. Gumley is currently offline  Liam E. Gumley
Messages: 378
Registered: January 2000
Senior Member
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
Re: Postscript Output [message #18734 is a reply to message #7108] Mon, 31 January 2000 00:00 Go to previous messageGo to next 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
Re: Postscript Output [message #18735 is a reply to message #7108] Mon, 31 January 2000 00:00 Go to previous messageGo to next message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Ingo (ingo.meisel@stud.uni-karlsruhe.de) writes:

> 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?

The page is empty!? I would have expected lousy output,
given the way you have configured the PostScript device,
but I wouldn't have expected the page to be empty.
I'm going to guess your image data isn't scaled into
256 values. Try something like this:

thisDevice = !D.Name
Set_Plot, 'PS'
Device, Color=1, Bits_per_Pixel=8, File='image.ps'
TV, BytScl(image)
Device, /Close_File
Set_Plot, thisDevice

You might also want to have a look at the Producing Perfect
PostScript Output section of my IDL Programming Tips
page for a number of other PostScript tips.

http://www.dfanning.com/documents/tips.html#PostScript

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: postscript output [message #76833 is a reply to message #7108] Wed, 06 July 2011 08:58 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> Use it like this:
>
> IDL> str = 'This is lambda symbol: ' + Greek(lambda)

Well, of course, this should be:

IDL> str = 'This is lambda symbol: ' + Greek("lambda")

Or, if you want a capital lambda symbol:

IDL> str = 'This is lambda symbol: ' + Greek("Lambda")

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thos speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
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: Wed Oct 08 15:11:34 PDT 2025

Total time taken to generate the page: 0.00838 seconds