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

Home » Public Forums » archive » Multiple Postscript Shaded Surface Plots
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
Multiple Postscript Shaded Surface Plots [message #7365] Fri, 08 November 1996 00:00 Go to next message
Walid is currently offline  Walid
Messages: 9
Registered: July 1996
Junior Member
Hi,

I've been having a bit of trouble getting multiple shaded surface plots
on a page. I tried using the !P.MULTI variable, but then the shaded
surface plots come out warped (they seem to be elongated in the
horizontal direction). Is there any way to draw multiple shaded surface
plots on a page using the postscript device while maintaining the
correct aspect ratio? Also, is it possible to write a tiff image of a
shaded surface (tiff_write is only for tv images)?

Thanks,

Walid
Re: Multiple Postscript Shaded Surface Plots [message #7417 is a reply to message #7365] Tue, 12 November 1996 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Arno F. Granados <granados> writes:

> You can explicitly specify the page location of each plot using the
> position Keyword in the call to plot. Set the !p.multi, and then
> use something like:
>
> plot,y,position=[1000,1000,6000,6000],/device

Yikes! Don't do something like this. Set *either* the !P.MULTI
system variable *OR* position each plot with the POSITION
keyword, but *don't* do BOTH. You will get some very
confusing results if you do.

And by the way, if you want portable code, I wouldn't be
doing this in DEVICE coordiates. I'd do it in NORMAL
coordiates. Then you don't have to write special code
for PostScript and for your display.

David

*************************************************
* David Fanning, Ph.D.
* 2642 Bradbury Court, Fort Collins, CO 80521
* Phone: 970-221-0438 Fax: 970-221-4762
* E-Mail: davidf@dfanning.com
*
* Sometimes I go about pitying myself, and all along my
* soul is being blown by great winds across the sky.
* -- Ojibway saying
************************************************
Re: Multiple Postscript Shaded Surface Plots [message #7448 is a reply to message #7365] Mon, 11 November 1996 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Walid <atia@wam.umd.edu> writes:

> I've been having a bit of trouble getting multiple shaded surface plots
> on a page. I tried using the !P.MULTI variable, but then the shaded
> surface plots come out warped (they seem to be elongated in the
> horizontal direction). Is there any way to draw multiple shaded surface
> plots on a page using the postscript device while maintaining the
> correct aspect ratio?

The problem here is probably that your display window
and the PostScript "window" don't have the same aspect
ratio. Hence, your PostScript output doesn't look like
the output on your display.

Everyone knows how to create a display window: use
the WINDOW command or just execute a graphics display
command. But I don't think everyone knows that you use
the DEVICE procedure in PostScript to set up the PostScript
"display window". That is, in fact, what you are doing
when you execute commands like this:

IDL> SET_PLOT, 'PS'
IDL> DEVICE, XSIZE=5, YSIZE=5, /INCHES

Once your "display window" is set up, you just issue
the same graphics commands you would normally, and
IDL uses pretty much the same rules it normally uses
to fill the window up. That's why things like !P.MULTI
and the POSITION keyword work so well when you are
trying to write IDL graphics procedures that work on
the regular display and in PostScript without a lot of
fooling around.

The default value for graphics windows on the display
is something like 640-by-512 pixels (this varies from
machine to machine). The default value for the PostScript
graphics window is 7-by-5 inches. You can see
this by typing:

IDL> SET_PLOT, 'PS'
IDL> HELP, /DEVICE

What you want to do is be sure your PostScript window
has the same aspect ratio as your display window. So
I would do something like this.

Suppose you are plotting in portrait mode in PostScript
and supposethe X size of your display window is always
larger than or equal to the Y size. Then you can get the
aspect ratio of your current display window by typing:

IDL> aspectRatio = FLOAT(!D. X_VSIZE)/!D.Y_VSIZE

Now, make your PostScript page the same. Type:

IDL> SET_PLOT, 'PS'
IDL> DEVICE, XSIZE=7, YSIZE=7/aspectRatio, /INCHES, $
IDL> XOFFSET=0.75, YOFFSET=(11 - (7/aspectRatio))/2.0

Now when you do your shaded surface plots, they should
look just like what you see on your display.

I've been fooling around with IDL since 1988 and it was
only a couple of weeks ago that I think I finally came to
terms with PostScript output. I had some nagging
problems with a colorbar procedure I published on this
newsgroup. I couldn't get the colorbar to appear *always*
the same on my display and in a PostScript file. Two
weeks ago I finally figured out how to do it. It was like
an epiphany!

I am pretty sure now that I can get nearly WYSIWYG output
from IDL (fonts still cause me a few problems). I am
writing my discoveries up in what I think of as the
Definitive Guide to IDL PostScript Output. (Like many
folks, the epiphany has gone to my head and made me
dizzy!) It will be part of Coyote's IDL Programming
Newsletter, an IDL programming tip sheet I am trying
to publish in my spare time. Send me an e-mail if you
would like to know more about it.

Yours,

David

*************************************************
* David Fanning, Ph.D.
* 2642 Bradbury Court, Fort Collins, CO 80521
* Phone: 970-221-0438 Fax: 970-221-4762
* E-Mail: davidf@dfanning.com
*
* Sometimes I go about pitying myself, and all along my
* soul is being blown by great winds across the sky.
* -- Ojibway saying
************************************************
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: window events
Next Topic: Plotting the terminator on a map

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

Current Time: Wed Oct 08 13:36:53 PDT 2025

Total time taken to generate the page: 0.00609 seconds