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

Home » Public Forums » archive » Re: How to rotate a 2-D plot and fit in the same view area ?
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: How to rotate a 2-D plot and fit in the same view area ? [message #7134 is a reply to message #7130] Fri, 27 September 1996 00:00 Go to previous message
gfu is currently offline  gfu
Messages: 10
Registered: October 1995
Junior Member
In article <davidf-ya023080002609962158590001@news.fortnet.org>, davidf@fortnet.org (David Fanning) writes:

Hi,

The example given by David will not rotate the labels for x and y axises.
I think to solve the problem need to use T3D. However I did some tests and
cannot figure out how to set keywords ROT and TRANS to get the correct plot
and position for the plot. Please use the following example as the base for
testing on different conditions.

x=[0,1]
y=[0,2]
T3D, /RESET, ROT=[0,0,-90], TRANS=[-1.0, 0.0, 0.0]
PLOT, x, y, /T3D

T3D, /RESET, ROT=[0,0,-90], TRANS=[-0.9, 0.0, 0.0]
PLOT, x, y, /T3D, POSITION=[0.5,0.5,0.8,0.8]

T3D, /RESET, ROT=[0,0,-90], TRANS=[-1.2, 0.0, 0.0]
PLOT, x, y, /T3D, POSITION=[0.5,0.5,0.8,0.8]

T3D, /RESET, ROT=[0,0,-90], TRANS=[-1.3, 0.0, 0.0]
PLOT, x, y, /T3D, POSITION=[0.5,0.5,0.8,0.8]


Gary


|> Gary Fu (gfu@shark.gsfc.nasa.gov) is trying to trip us up with
|> a trick question when he writes:
|>
|> > Does any one know how to rotate a 2-D plot 90 degree (clockwise) so that
|> > the result still displays on the same viewing area defined by !p.position ?
|>
|> Uh, *any* plot you draw with the POSITION keyword set the same is going to go
|> into the same position into the window.
|>
|> > For example, how do I rotate the result of
|> > 'PLOT, [0,1], position=[0.5,0.5,0.9,0.9]' 90 degree and still displays in
|> > the [0.5,0.5,0.9,0.9] viewing area ?
|>
|> Well, this is a tricky example. Try this one (so you can see the rotation).
|>
|> a = FINDGEN(11)
|> b = a * 30
|>
|> ; Regular plot.'
|>
|> WINDOW, 0
|> PLOT, a, b, POSITION=[0.5,0.5,0.9,0.9]
|>
|> ; Plot rotated by 90 degrees.
|>
|> WINDOW, 1
|> PLOT, b, a, POSITION=[0.5,0.5,0.9,0.9]
|>
|> Same position in window. Axes rotated by 90 degrees (?!).
|>
|> Or (it just occurs to me!) to *really* rotate the first plot
|> by 90 degrees, do this:
|>
|> PLOT, b, a, POSITION=[0.5,0.5,0.9,0.9], YRANGE=[10,0]
|>
|> Alright, I give up! What's the answer? :-)
|>
|> David
|>
|> --
|> David Fanning, Ph.D.
|> Phone: 970-221-0438
|> Fax: 970-221-4728
|> E-Mail: davidf@fortnet.org

--

*****************************************
* Gary Fu, GSC (301) 286-7107 *
* email : "gfu@shark.gsfc.nasa.gov" *
* Laboratory for Hydrospheric Processes *
* NASA/Goddard Space Flight Center *
*****************************************
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: idl can not read TIFF image
Next Topic: Re: Plot Widget under IDL

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

Current Time: Wed Dec 03 11:01:53 PST 2025

Total time taken to generate the page: 0.96637 seconds