OK, Gary, *now* I see what you want to do. You were almost there. You write:
> 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=[-1.3, 0.0, 0.0]
> PLOT, x, y, /T3D, POSITION=[0.5,0.5,0.8,0.8]
>
The second PLOT command above will work. In fact it *does*
work. (Although I had to add a NOCLIP keyword to see the plot.
The result, I think, of round-off considerations on some machines.)
But what you are missing is that the POSITION keyword applies
to the position of the plot in the XY plane. So this plot goes
exactly where you tell it to go.
The problem, of course, is that you didn't want it at the right
position in the XY plane (which you just successfully rotated).
You wanted in the same position in your display window (which
you *didn't* rotate!).
To compensate for the fact that you rotated the XY plane but
not the display window, you have to perform a transformation
of the position coordinates as well. The example program
below does that successfully.
But just one question. *WHY* do you want to do this!? :-)
************************************************
PRO EXAMPLE
; Set up position in display window.
position = [0.5, 0.5, 0.8, 0.8]
; Normal plot.
WINDOW, 0, TITLE='NORMAL PLOT'
x=[0,1]
y=[0,2]
PLOT, x, y, POSITION=position
; Rotate the plot 90 degrees.
WINDOW, 1, TITLE='ROTATED PLOT'
T3D, /RESET, ROT=[0,0,-90], TRANS=[-1.0, 0.0, 0.0]
; Transform the position coordinates to account for NO rotation
; in the display window
temp = position(0)
position(0) = 1.0 - position(2)
position(2) = temp
; Draw the plot at same position in DISPLAY window.
PLOT, x, y, POSITION=position, /T3D, /NOCLIP
END
************************************************
Thanks for the challenging problem!
Yours,
David
--
David Fanning, Ph.D.
Phone: 970-221-0438
Fax: 970-221-4728
E-Mail: davidf@fortnet.org
|