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

Home » Public Forums » archive » rotating 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
rotating plots [message #19076] Fri, 25 February 2000 00:00 Go to next message
Stuart Colley is currently offline  Stuart Colley
Messages: 17
Registered: February 2000
Junior Member
Does anyone know of a simple way to rotate a normal line plot through 90
degrees, such that the x-axis is now in the y direction and the y-axis in
the x direction.

cheers,
S
Re: rotating plots [message #19168 is a reply to message #19076] Fri, 25 February 2000 00:00 Go to previous messageGo to next message
Stuart Colley is currently offline  Stuart Colley
Messages: 17
Registered: February 2000
Junior Member
On Fri, 25 Feb 2000, Pavel Romashkin wrote:

> Will changing the order of X and Y in the PLOT command work?
>
That did the trick, I'd never have guessed it would be as obvious as that
though.

thanx
S

____________________________________________________________ __________

telephone: +44 (0)20 7419 3483
home page: http://www.star.ucl.ac.uk/~src/

Please reply in plain text ONLY: MS Word, html, etc, are
automatically sent to /dev/null (i.e. deleted).
Re: rotating plots [message #19172 is a reply to message #19076] Fri, 25 February 2000 00:00 Go to previous messageGo to next message
Pavel Romashkin is currently offline  Pavel Romashkin
Messages: 166
Registered: April 1999
Senior Member
Will changing the order of X and Y in the PLOT command work?

Cheers,
Pavel

Stuart Colley wrote:
>
> Does anyone know of a simple way to rotate a normal line plot through 90
> degrees, such that the x-axis is now in the y direction and the y-axis in
> the x direction.
Re: rotating plots [message #42363 is a reply to message #19076] Thu, 27 January 2005 18:24 Go to previous messageGo to next message
Rob[1] is currently offline  Rob[1]
Messages: 5
Registered: January 2005
Junior Member
That's what I was looking for Andry. The simplicity speaks for
itself...especially when I just spent the last 1/2 hour working with
!P.T and T3D (and it still looked a lot worse than your solution).
Thanks!

Rob

Andry William wrote:
> Rob wrote:
>> Hi,
>>
>> Can anyone tell me an easy way in direct graphics to rotate a line
plot
>> counter-clockwise by 90 degrees so that the x axis is now in the
>> positive y direction and the y axis is now in the negative x
direction?
>> Simply swapping the x and y vectors in the PLOT command doesn't
quite
>> do it.
>>
>> Thanks,
>>
>> Rob
>>
> Might help as a starting point
>
> b=randomu(n,10)
> x=indgen(10)
> window, 0 & plot, x, b
> window, 1 & plot, b, x, xrange= [1,0]
>
> Andry
Re: rotating plots [message #42365 is a reply to message #19076] Thu, 27 January 2005 18:16 Go to previous messageGo to next message
war is currently offline  war
Messages: 21
Registered: December 2003
Junior Member
Rob wrote:
> Hi,
>
> Can anyone tell me an easy way in direct graphics to rotate a line plot
> counter-clockwise by 90 degrees so that the x axis is now in the
> positive y direction and the y axis is now in the negative x direction?
> Simply swapping the x and y vectors in the PLOT command doesn't quite
> do it.
>
> Thanks,
>
> Rob
>
Might help as a starting point

b=randomu(n,10)
x=indgen(10)
window, 0 & plot, x, b
window, 1 & plot, b, x, xrange= [1,0]

Andry
Re: rotating plots [message #42366 is a reply to message #19076] Thu, 27 January 2005 18:13 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Rob writes:

> Can anyone tell me an easy way in direct graphics to rotate a line plot
> counter-clockwise by 90 degrees so that the x axis is now in the
> positive y direction and the y axis is now in the negative x direction?
> Simply swapping the x and y vectors in the PLOT command doesn't quite
> do it.

The simplest way (used by a lot of astrophysicists, it turns
out) is to output to PostScript instead of to the display,
then just give the page a sort of "twist". Or, alternatively,
I think you can crink your neck around a quarter turn.

But that is about the size of it in IDL, I'm afraid. ;-(

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Re: rotating plots [message #42367 is a reply to message #19076] Thu, 27 January 2005 17:56 Go to previous messageGo to next message
Rob[1] is currently offline  Rob[1]
Messages: 5
Registered: January 2005
Junior Member
Hi,

Can anyone tell me an easy way in direct graphics to rotate a line plot
counter-clockwise by 90 degrees so that the x axis is now in the
positive y direction and the y axis is now in the negative x direction?
Simply swapping the x and y vectors in the PLOT command doesn't quite
do it.

Thanks,

Rob
Re: Rotating plot [message #58596 is a reply to message #19076] Wed, 06 February 2008 17:23 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
hazel writes:

> Hi all,
>
> I have question pertaining to a 'would like to have - I'm sure IDL
> does it somehow' plot format.
>
> I would like to plot 2 plots side by side (I can do this).
>
> The first is Plot, x, y. The second is a histogram of number of
> samples vs. y which I would like to rotate so that the y axes of both
> plots are aligned.
>
> I'm currently doing:
>
> !P.MULTI=[0,2,1]
> set_plot, 'ps'
>
> DEVICE,FILENAME='plot.ps',/landscape, XSIZE=24.0, YSIZE=10.0, /cm
> ; translation
> and ;counterclockwise rotation about the z axis
> plot,x, y
>
> HIST_PLOT, y ; (Thank-you, Liam - a lifesaver)
>
> (Within which:
>
> plot, x,y, /T3D)
>
>
> But my plot rotates correctly but looks very squashed and elongated,
> yet I've not touched the dimensions of the plot (to my knowledge).

You are asking too much of !P.MULTI. It needs you to
leave *everything* up to it. When you throw T3D in
there, you totally screw up the system variables
!P.MULTI requires. You will want to position your
plots with the position keywords and NOERASE. Leave
!P.MULTI out of it. :-)

Something like this:

data = fix(randomu(seed, 100) * 10)
plot, data, position=[0.1, 0.1, 0.6, 0.9]
T3D, /RESET, TRANS=[0.0, -1.0, 0.0], ROT=[0,0,90]
plot, histogram(data), /noerase, $
position = [0.1, 0.1, 0.9, 0.3], /T3D

I couldn't find Liam's Hist_Plot. Have you seen my
HistoPlot?

IDL> Histoplot, Fix(RandomU(seed, 200)*20), $
POLYCOLOR=['charcoal', 'steel blue'], /FILLPOLYGON

You can find more about it here:

http://www.dfanning.com/graphics_tips/histoplot.html

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Rotating plot
Next Topic: An IDL cron job, true color plots, Xvfb, Z-buffer, and all sorts of troubles

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

Current Time: Sat Oct 11 14:30:20 PDT 2025

Total time taken to generate the page: 0.56370 seconds