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

Home » Public Forums » archive » Re: Log IDLgrAxis
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: Log IDLgrAxis [message #26198] Thu, 09 August 2001 14:29 Go to next message
david[2] is currently offline  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 #26199 is a reply to message #26198] Thu, 09 August 2001 14:27 Go to previous messageGo to next message
david[2] is currently offline  david[2]
Messages: 100
Registered: June 2001
Senior Member
Pavel A. Romashkin writes:

> Thank you David. I went throgh some older messages on this subject and
> experimented for a couple of hours, and found that log object axes are
> useless for me, just like I can't find use for IDLgrContour. Changing
> data contents of plots to go to log axes is too much for me :-(
> One more reason DG will never be outdated.

Nuts. OK, I'll scratch you off that list of five
people who were going to buy that object graphics
book I'm 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 #26201 is a reply to message #26199] Thu, 09 August 2001 13:53 Go to previous messageGo to next message
Pavel A. Romashkin is currently offline  Pavel A. Romashkin
Messages: 531
Registered: November 2000
Senior Member
Thank you David. I went throgh some older messages on this subject and
experimented for a couple of hours, and found that log object axes are
useless for me, just like I can't find use for IDLgrContour. Changing
data contents of plots to go to log axes is too much for me :-(
One more reason DG will never be outdated.
Cheers,
Pavel
Re: Log IDLgrAxis [message #26203 is a reply to message #26201] Thu, 09 August 2001 13:35 Go to previous messageGo to next message
david[2] is currently offline  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 #26204 is a reply to message #26203] Thu, 09 August 2001 13:01 Go to previous messageGo to next message
Pavel A. Romashkin is currently offline  Pavel A. Romashkin
Messages: 531
Registered: November 2000
Senior Member
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
Re: Log IDLgrAxis [message #26205 is a reply to message #26204] Thu, 09 August 2001 12:56 Go to previous messageGo to next message
david[2] is currently offline  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 #26206 is a reply to message #26205] Thu, 09 August 2001 12:36 Go to previous messageGo to next message
Pavel A. Romashkin is currently offline  Pavel A. Romashkin
Messages: 531
Registered: November 2000
Senior Member
David Fanning wrote:
>
> Sounds to me like you are forgetting to scale
> it back into your arbitrary coordinate system.

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.

Pavel
Re: Log IDLgrAxis [message #26208 is a reply to message #26206] Thu, 09 August 2001 11:42 Go to previous messageGo to next message
david[2] is currently offline  david[2]
Messages: 100
Registered: June 2001
Senior Member
Pavel A. Romashkin writes:

> Is there a trick to making a log object axis to display properly? I have
> a linear axis perfectly working, but as soon as I try to set /log
> property, I get a message "infinite plot range" and the axis is
> collapsed to a point, with all labels piled up on top of one another.
> What is happening?

Sounds to me like you are forgetting to scale
it back into your arbitrary coordinate system.

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 Go to previous message
Doug Reynolds is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: color widget
Next Topic: Re: Array multiplication: implicit loop query

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

Current Time: Wed Oct 08 13:19:14 PDT 2025

Total time taken to generate the page: 0.00445 seconds