moving axes around in 3D plots [message #3730] |
Tue, 28 February 1995 12:07  |
vek
Messages: 9 Registered: November 1994
|
Junior Member |
|
|
I want to plot some surfaces from various angles but still have the axes be
visible. The IDL manual suggests using reverse to move the surface viewing
angle without altering the axes (usually by reversing the direction of one
or more axes), but I prefer to rotate the image to the desired angle and
then change the position of the axes without changing the directions of the
axes. How do I do this?
Ex: Change (A) to (B) by moving the y and z axes to the other side of
the x.
(A) (B)
|z |z
| |
| |
/ ---> \ /
/y x \ /y
/ \/
\
\x
\
--
Vincent Kargatis -- Space Physics & | "Must be Texans. Lowest form
Astronomy, Rice U., Houston, TX | of White Man there is."
[vek@spacsun.rice.edu] | -- Robert Duvall's character in
[http://spacsun.rice.edu/~vek/vek.html] | GERONIMO: AN AMERICAN LEGEND
|
|
|
Re: Moving Axes [message #58504 is a reply to message #3730] |
Wed, 30 January 2008 07:13  |
Brian Larsen
Messages: 270 Registered: June 2006
|
Senior Member |
|
|
> I'm plotting data which has both +ve and -ve x and y values and
> possesses a linear relationship which crosses the xaxis at a value>0. At the moment my x-axis is 'sitting' at y= -5,
This is normal IDL behavior, IDL draws a box around the plot with the
ranges on it so you probably have an xaxis 'sitting' at -5 and another
at +6 (or something).
A more specific example could help us understand more fully but in my
example:
plot, findgen(10)-5
i have a xaxis at y=-6 and y=+4.
I often draw a horizontal line on a plot at y=0 to help guide the eye,
done without thinking using:
http://people.bu.edu/balarsen/IDLdoc/oplot_horiz.html
http://people.bu.edu/balarsen/IDLdoc/oplot_vertical.html
As for making the plot with the x-axis in the middle of the plot at
y=0, I am sure this is possible but I cant recall any easy way. Have
you looked though http://dfanning.com/ ? An amazing number of
questions are answered there,
Cheers,
Brian
------------------------------------------------------------ -------------
Brian Larsen
Boston University
Center for Space Physics
|
|
|
Re: Moving Axes [message #58506 is a reply to message #3730] |
Wed, 30 January 2008 07:10  |
Allan Whiteford
Messages: 117 Registered: June 2006
|
Senior Member |
|
|
chloesharrocks@gmail.com wrote:
> Dear all
>
> I'm plotting data which has both +ve and -ve x and y values and
> possesses a linear relationship which crosses the xaxis at a value
>
>> 0. At the moment my x-axis is 'sitting' at y= -5, which makes it
>
> very hard to notice that the xintercept is positive when just looking
> at the graph (I do have an xyout output telling me the xintercept
> value, but it would be nice if just a quick glance at the graph made
> this obvious). Is there any way for me to move the x-axis up so it
> sits on y=0 (and similarly moving the y-axis so its at x=0) but so
> that my negative value data is still plotted? I presume there must be
> an easy way to do this in IDL - at the moment I'm just overplotting
> lines corresponding to y=0 and x=0 just so I can clearly see the
> xintercept's positive.
>
> Thanks
> Chlo�
>
> PS. I'm a complete IDL novice, so the simpler the better please!
Chlo�,
Look at the AXIS procedure.
E.g.:
IDL> plot,findgen(11)-5,findgen(11)-5,xstyle=4,ystyle=4
IDL> axis,0,0
IDL> axis,0,0,/yax
Thanks,
Allan
|
|
|