Re: SCALE3.pro isn't doing it's job [message #67486] |
Thu, 30 July 2009 19:12  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Brian Daniel writes:
> I'm using the SCALE3 procedure to initialize the !P.T variable for a
> 3D scatter plot with the following commands:
>
> xRange = [min(rot_image[0,*]),max(rot_image[0,*])]
> yRange = [min(rot_image[1,*]),max(rot_image[1,*])]
> zRange = [min(rot_image[2,*]),max(rot_image[2,*])]
> print,'X Range:',xRange
> print,'Y Range:',yRange
> print,'Z Range:',zRange
> Scale3,XRange=xRange,$
> YRange=yRange,$
> ZRange=zRange,$
> Ax=45, Az=80
>
> The problem is when I plot the axes using the "AXIS" command, they
> plot as if their range is zero (little stubby nubs of an axis).
The "default" range for the AXIS command is 0 to 1. The
AXIS command is not going to get its values from the
transformation information set up by Scale3, although
it will get its position from there (assuming you use
the T3D keyword when you call it). See this article
for how to build a 3D scatterplot:
http://www.dfanning.com/tip_examples/scatter3d.pro
You will have to set the [XYZ]Range keywords on your AXIS
commands to get the right range for the axes. Here I use
the SURFACE command to set up the transformation matrix,
but I could have used SCALE3:
SURFACE, DIST(5), /NODATA, /SAVE, XRANGE=[0,100], $
YRANGE=[-50,50], ZRANGE=[0, max(z)], XSTYLE=1, $
YSTYLE=1, ZSTYLE=1, CHARSIZE=1.5, $
POSITION=[0.1, 0.1, 0.95, 0.95, 0.1, 0.95], $
XTICKLEN=1, YTICKLEN=1, XGRIDSTYLE=1, YGRIDSTYLE=1
AXIS, XAXIS=1, /T3D, CHARSIZE=1.5, XRANGE=[0,100]
AXIS, YAXIS=1, /T3D, CHARSIZE=1.5, YRANGE=[-50,50]
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.")
|
|
|
Re: SCALE3.pro isn't doing it's job [message #67560 is a reply to message #67486] |
Fri, 31 July 2009 05:37  |
Brian Daniel
Messages: 80 Registered: July 2009
|
Member |
|
|
It worked! But not with Scale3. I tried adding the range keywords to
AXIS (and I am using /T3D) but it didn't change my nubby axes. So I
used the exact surface command below and adjusted the [XYZ]Range
keywords accordingly. I shall choose to Surface over Scale3 from now
on. Thanks for your help.
FYI, I just bought your book. It rocks. Seriously rocks, and I'm only
on page 102!
On Jul 30, 10:12 pm, David Fanning <n...@dfanning.com> wrote:
>
> SURFACE, DIST(5), /NODATA, /SAVE, XRANGE=[0,100], $
> YRANGE=[-50,50], ZRANGE=[0, max(z)], XSTYLE=1, $
> YSTYLE=1, ZSTYLE=1, CHARSIZE=1.5, $
> POSITION=[0.1, 0.1, 0.95, 0.95, 0.1, 0.95], $
> XTICKLEN=1, YTICKLEN=1, XGRIDSTYLE=1, YGRIDSTYLE=1
> AXIS, XAXIS=1, /T3D, CHARSIZE=1.5, XRANGE=[0,100]
> AXIS, YAXIS=1, /T3D, CHARSIZE=1.5, YRANGE=[-50,50]
>
> 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.")
|
|
|