Re: Is there a way to keep axis text from scaling? [message #17529] |
Sat, 30 October 1999 00:00 |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Mark Hadfield (m.hadfield@niwa.cri.nz) writes:
>> axistext->setproperty, font=self.complexPlotFont, $
>> Recompute_Dimensions=2
>
> This works for the axis title but not for the tick text, i.e. the following
>
> oaxis->GetProperty, TICKTEXT=ticktext
> ticktext->SetProperty, RECOMPUTE_DIMENSIONS=2
>
> has no effect. An extra keyword to IDLgrAxis::Init, allowing this behaviour
> to be overridden, would be nice.
Unless I completely misunderstand what I am seeing, it
appears to work for *all* the text on the axis. Do you
have an example that doesn't work, Mark? I'm using
IDL 5.2.1.
> (My news server refused to post this message because there is more included
> text than new. So here's some more new text:
> ABCDEFGHABCDEFGHABCDEFGHABCDEFGHABCDEFGHABCDEFGHABCDEFGHABCD EFGHABCDEFGHABCD
> [etc.]
Uh, I think you can turn this off under the Global
Options/Replying tab, Mark. But I always appreciate
learning about other innovative solutions. :-)
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: Is there a way to keep axis text from scaling? [message #17537 is a reply to message #17529] |
Fri, 29 October 1999 00:00  |
Karri Kaksonen
Messages: 27 Registered: October 1999
|
Junior Member |
|
|
Thank you David.
David Fanning wrote:
> Karri Kaksonen (karri.kaksonen@picker.fi) writes:
>> I wrote some object graphics axes and found out that I
>> cannot change the data range without scaling the font at
>> the same time.
>
> Whoops! This was something that I thought to mention
> several times in the course last week and every time
> promptly forgot to do it in the heat of battle. :-)
>
Did you ever read the object graphics book that belonged
to the course?
I know that we had no time to open it during the course.
Now when I came home and tried to find things in there
I noticed that they used object programming only for the
graphic elements in the book.
Some vital parts of the object oriented stuff with
methods and windows was missing from the book.
Fortunately I still remember how to do it.
> axistext->setproperty, font=self.complexPlotFont, $
> Recompute_Dimensions=2
The Recompute_Dimensions=2 fixed it.
I am actually starting to like object graphics more
all the time. The thing that really makes a difference is
the professional feel of the user interface and the
modularity of the code.
Besides, programming in this style opens up new views
all the time. It is quite refreshing.
--
Regards,
Karri Kaksonen
|
|
|
Re: Is there a way to keep axis text from scaling? [message #17540 is a reply to message #17537] |
Fri, 29 October 1999 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Karri Kaksonen (karri.kaksonen@picker.fi) writes:
> I wrote some object graphics axes and found out that I
> cannot change the data range without scaling the font at
> the same time.
>
> The solution to kill the axis and re-create them is not
> very pretty. Does somebody have a better solution?
Whoops! This was something that I thought to mention
several times in the course last week and every time
promptly forgot to do it in the heat of battle. :-)
What we want to do here is recompute the text scaling
when we change the axis range that the text object
is attached to. We can control when the scaling occurs
by setting the RECOMPUTE_DIMENSIONS property of the
text object. In this case, you would like to *always*
recompute the text dimensions, so I would set this
property at the same time you assign the font object
to the text object in the INIT method of your object:
axistext->setproperty, font=self.complexPlotFont, $
Recompute_Dimensions=2
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
|
|
|