Re: IDLgrPLOT and log [message #10587] |
Thu, 08 January 1998 00:00 |
Matthew Hanson
Messages: 11 Registered: October 1997
|
Junior Member |
|
|
Hello Bernard,
I had the same question about log plots a while ago and Randy Frank
answered my question. The documentation for this is lacking - it
requires a lot more than the simple keyword for IDLgrAxis. You must
transform the Plot Limits and your data to log results before plotting.
So, for example, a plot from 0.01 to 100 in log scale would have view
plot boundaries from -2 to 2. THe View would also need an equivalent
area (with extra space for axis text and such. When plotting the data
just plot alog10(data) rather than just data. Hope this helps.
Following is the original post from before along with Randy Frank's
(from RSI) answer. There is a short example at the end.
-matt
==================================
Matthew Hanson wrote:
(snip)
> Has anyone else tried making object log plots?
> There are no examples of log plots in any of the IDL examples. It
> appears in none of the books. In fact the word log only appears >once -
> as a keyword to the IDLgrAxis object.
Matt, I agree that the docs need to be updated wrt the LOG property.
It helps
to begin with the (current) basis of object graphics. Data spaces which
cannot
be described using a 4x4 matrix transform are not directly supported as
inverse
transforms cannot be placed in the graphics hardware. The LOG property
tells the axis object how to select its text labels and where to place
the tickmarks
it does not transform the data space (it cannot as it does not "own" any
children and thus any data space). So, you need to setup your viewport
for the
log of the data. Note that there is no LOG keyword on the IDLgrPlot
object
either, so you must log your data before you put it in the Plot object
and the
data space you are using is then linear in log space. This is a lot
more work
than required in direct graphics, but what most people have done is to
create
a "myplot" subclass which handles this (and any other non-linear data
transform) and usually combines the axis w/the plot object. This is the
state of affairs in the current release of IDL, things may be changing
in
the future...
Quick example:
w=obj_new("idlgrwindow")
v=obj_new("idlgrview",view=[-1,-1,4,4])
v->add,m
a=obj_new("idlgraxis",range=[1,100],/log)
m->add,a
w->draw,v
Hope it helps.
Bernard Puc wrote:
>
> Hello,
> Can somebody show me an example of plotting on a log/log scale using
> ObjectGraphics? I'm trying to learn Object Graphics and I can't seem to
> get log plots. Any help appreciated. Thanks.
>
> -Bernard Puc
--
Matthew Hanson
KTAADN, Inc. Phone: (617)527-0054
1320 Centre Street, Suite 201 Fax: (617)527-9321
Newton, MA 02159
matt@ktaadn.com matth@who.net vroomfogle@worldnet.att.net
|
|
|