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

Home » Public Forums » archive » OBJ_AXIS tick labels
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: OBJ_AXIS tick labels [message #15077 is a reply to message #14991] Wed, 14 April 1999 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Pavel Romashkin (pavel@terra.colorado.edu) writes:

> Could anyone tell me: do I really have to individually call SETPROPERTY,
> RECOMPUTE=2 for axis tick labels (which, by the way, are not so easily
> accessible from an axis object) each time I change viewplane rectangle
> (when placing data in PLOT object after initializing it with no data),
> or there is a smart way to do that? Once I change the data in a plot
> object, re-limit axes and recalculate viewplane rectangle, tick labels
> get squeesed. So do axes titles, despite having their RECOMPUTE set to
> 2. If I set RECOMPUTE to2 after the transformation, everything looks
> ok, but shouldn't CHAR_SIZE be recomputed automatically if RECOMPUTE is
> set to 2?

Well, no question you have to recompute the polygons after
you re-scale the axes. I don't know why you have to do
it by hand every time. I've never seen this. Perhaps because
you are recalculating the viewplane rectangle. I tend to
leave the veiwplane rectangle alone and scale everything
into it.

Here is the code I use to define one of my axes. You see how
I get the axes labels and set them to recompute themselves.
The "xtitle" variable is a text object that also has
Recompute_Dimensions set to 2.

xAxis1 = Obj_New("IDLgrAxis", 0, Color=[255,255,0], Ticklen=0.025, $
Minor=4, Range=xrange, Title=xtitle, XCoord_Conv=xs, $
Location=[1000, 0 ,0], /Exact)
xAxis1->GetProperty, Ticktext=xAxisText
helvetica10pt = Obj_New('IDLgrFont', 'Helvetica', Size=10)
xAxisText->SetProperty, Font=helvetica10pt, Recompute_Dimensions=2

After I load new data, I have code that looks something like this.
Normalize is a utility routine that creates scaling factors to
scale the data into 0 to 1, which is appropriate for the
viewplane rectangle I'm using.

info.thisPlot->SetProperty, DataX = x, DataY = y
info.thisPlot->GetProperty, XRange=xrange, YRange=yrange
xs = Normalize(xrange)
ys = Normalize(yrange)
info.thisPlot->SetProperty, XCoord_Conv=xs, YCoord_Conv=ys

info.xaxis1->SetProperty, XCoord_Conv=xs, Range=xrange
info.yaxis1->SetProperty, YCoord_Conv=ys, Range=yrange

The axis labels and titles now appear fine. That is, they
get recomputed correctly and automatically.

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

[Note: This follow-up was e-mailed to the cited author.]
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Joining comp.lang.idl-pvwave
Next Topic: Documentation

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

Current Time: Sun Oct 12 12:20:04 PDT 2025

Total time taken to generate the page: 1.51851 seconds