Re: Log IDLgrAxis [message #26198] |
Thu, 09 August 2001 14:29  |
david[2]
Messages: 100 Registered: June 2001
|
Senior Member |
|
|
Whoops! I wrote just a moment ago...
> Nuts. OK, I'll scratch you off that list of five
> people who were going to buy that object graphics
> book I'm writing. :-(
I meant, of course, the book I'm **SUPPOSED**
to be writing.
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
|
|
|
|
|
Re: Log IDLgrAxis [message #26203 is a reply to message #26201] |
Thu, 09 August 2001 13:35   |
david[2]
Messages: 100 Registered: June 2001
|
Senior Member |
|
|
Pavel A. Romashkin writes:
>
> Well, this is what I see:
>
> IDL> junk = obj_new('idlgraxis')
> IDL> junk -> setproperty, /log
> % IDLGRAXIS::SETPROPERTY: Warning: Infinite plot range.
> IDL> junk -> setproperty, range=[0., 10000.], xcoord_conv =
> normalize([0., 10000.])
> % Compiled module: NORMALIZE.
> % IDLGRAXIS::SETPROPERTY: Warning: Infinite plot range.
>
> ???
Well, I'm not surprised. Log plots have never
cared for zeros too much. :-(
How about this:
IDL> junk = obj_new('idlgraxis', range=[1,1000])
IDL> junk -> setproperty, /log
IDL> junk -> setproperty, range=[1., 10000.], $
IDL> xcoord_conv =normalize([1., 10000.])
Remember that the default range on a axis object
is 0 to 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
|
|
|
|
Re: Log IDLgrAxis [message #26205 is a reply to message #26204] |
Thu, 09 August 2001 12:56   |
david[2]
Messages: 100 Registered: June 2001
|
Senior Member |
|
|
Pavel A. Romashkin writes:
> I am setting /log before any Range or Coord_conv are specified - at the
> time of creating the new axis. All normalization happens afterwards and
> is the same as for linear axis.
Now I'm remembering something, let me look...
Aha, here is an article I wrote about this
some time ago:
##########################################################
Subject: Re: IDLgrAxis object with /LOG keyword
From: davidf@dfanning.com (David Fanning)
Date: Thu, 18 Jan 2001 12:14:49 -0700
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
|
|
|
|
|
Re: Log IDLgrAxis [message #26249 is a reply to message #26204] |
Mon, 13 August 2001 06:32  |
Doug Reynolds
Messages: 2 Registered: April 2001
|
Junior Member |
|
|
"Pavel A. Romashkin" wrote:
> David Fanning wrote:
>>
>> Pavel A. Romashkin writes:
>>
>> Sounds to me like you are forgetting to scale
>> it back into your arbitrary coordinate system.
>
> Well, this is what I see:
>
> IDL> junk = obj_new('idlgraxis')
> IDL> junk -> setproperty, /log
> % IDLGRAXIS::SETPROPERTY: Warning: Infinite plot range.
> IDL> junk -> setproperty, range=[0., 10000.], xcoord_conv =
> normalize([0., 10000.])
> % Compiled module: NORMALIZE.
> % IDLGRAXIS::SETPROPERTY: Warning: Infinite plot range.
>
> ???
> Pavel
I'm not overly familiar with object graphics, but it looks like you have
a log axis with a minimum value of zero? This seems likely to be a
source of problems.
Doug
|
|
|