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

Home » Public Forums » archive » Re: IDLgrAxis object with /LOG keyword
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
Re: IDLgrAxis object with /LOG keyword [message #23265] Thu, 18 January 2001 22:53
marc schellens[1] is currently offline  marc schellens[1]
Messages: 183
Registered: January 2000
Senior Member
Thanks alot, looking for [XY]RANGE was the right hint.
:-))) marc
Re: IDLgrAxis object with /LOG keyword [message #23275 is a reply to message #23265] Thu, 18 January 2001 11:14 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Marc Schellens (m_schellens@hotmail.com) writes:

> I want to create a loarithmic plot with object graphics.
> So I thought I just set the /LOG keyword to the IDLgrAxis object and
> scale the data accordingly.
> But with the /LOG keyword the Axis is drawn on a different location.
> Does anybody have an example how to do it right?

Humm. This gave me some trouble too. Then I remembered that
CRANGE returns the log of the range when axes are set to
log type. So, to get things to work, I had to scale the
axis (Z-Axis in this case) differently from the data in
the Z direction.

Here is how I modified my FSC_SURFACE program to get
it to work with a log Z axis. (I set the LOG keyword
on the IDLgrAxis command for the Z axis.)

************************************************************ ***********
; The axes may not use exact axis scaling, so the ranges may
; have changed from what they were originally set to. Get
; and update the range variables.

xAxis->GetProperty, CRange=xrange
yAxis->GetProperty, CRange=yrange
zAxis->GetProperty, CRange=zrange
zrange_surf = [10^zrange[0], 10^zrange[1]]

; Set scaling parameters for the surface and axes so that everything
; is scaled into the range -0.5 to 0.5. We do this so that when the
; surface is rotated we don't have to worry about translations. In
; other words, the rotations occur about the point (0,0,0).

xs = Normalize(xrange, Position=[-0.5,0.5])
ys = Normalize(yrange, Position=[-0.5,0.5])
zs = Normalize(zrange, Position=[-0.5,0.5])
zsurf = Normalize(zrange_surf, Position=[-0.5,0.5])

; Scale the axes and place them in the coordinate space.
; Note that not all values in the Location keyword are
; used. (I've put really large values into the positions
; that are not being used to demonstate this.) For
; example, with the X axis only the Y and Z locations are used.

xAxis->SetProperty, Location=[9999.0, -0.5, -0.5], XCoord_Conv=xs
yAxis->SetProperty, Location=[-0.5, 9999.0, -0.5], YCoord_Conv=ys
zAxis->SetProperty, Location=[-0.5, 0.5, 9999.0], ZCoord_Conv=zs

; Scale the surface.

thisSurface->SetProperty, XCoord_Conv=xs, YCoord_Conv=ys, ZCoord_Conv=zsurf
************************************************************ ***********


I put this example program here if you want to try it out:

ftp://ftp.dfanning.com/oub/outgoing/misc/fsc_surface_log.pro

I ran it like this:

IDL> .Compile fsc_surface_log
IDL> fsc_surface, dist(50)*40 > 1

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Speaking of .wav files...
Next Topic: check for duplicate routine names?

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

Current Time: Wed Oct 08 14:01:21 PDT 2025

Total time taken to generate the page: 0.00694 seconds