Re: NG font size for axis titles [message #72760] |
Fri, 08 October 2010 12:49 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Chris Torrence writes:
> Right now, your best approach is to use the text function. Just like
> direct graphics (DG), there is currently no easy way to change the
> font size of just the axis title.
>
> One tip - if you use the /data keyword with the text function, then
> you can specify the location in "data" coordinates, which might be a
> bit simpler than normalized coordinates. Something like this:
>
> p = Plot(/test)
> yr = p.yrange
> t = Text(mean(p.xrange),yr[0]-0.12*(yr[1]-yr[0]), 'X title', $
> /DATA, ALIGNMENT=0.5, FONT_SIZE=1.25*p.font_size)
In response to this question and the question about
mirror image values on the contour command from a few
days ago, I was reading this article again about
how to reverse an object graphics axis:
http://www.dfanning.com/ographics_tips/axis_reverse.html
Yep. As I remember, it's not as easy as you might
think! :-)
But I did learn you can't do both the title and the
axis annotation together.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: NG font size for axis titles [message #72764 is a reply to message #72760] |
Fri, 08 October 2010 12:20  |
Matt Haffner
Messages: 34 Registered: October 2000
|
Member |
|
|
After much hunting through the NG and iTools code, I convinced myself
that (for now) there is no way to do it via the axis object. It
appears there is only a single font property that an axis carries
around, unfortunately.
mh
On Oct 8, 9:58 am, David Grier <david.gr...@nyu.edu> wrote:
> I'm looking for the "right" way to set the font size on the
> axis titles in NG graphics. The font_size keyword sets the axis
> labels to the same size as the axis titles. I'd like to make the titles
> a little larger. One kludgy approach is to leave the titles off and
> paint them in after the fact with the text function. There ought to
> be a better way.
>
> Thanks,
>
> David
|
|
|
Re: NG font size for axis titles [message #72765 is a reply to message #72764] |
Fri, 08 October 2010 08:54  |
chris_torrence@NOSPAM
Messages: 528 Registered: March 2007
|
Senior Member |
|
|
On Oct 8, 8:58 am, David Grier <david.gr...@nyu.edu> wrote:
> I'm looking for the "right" way to set the font size on the
> axis titles in NG graphics. The font_size keyword sets the axis
> labels to the same size as the axis titles. I'd like to make the titles
> a little larger. One kludgy approach is to leave the titles off and
> paint them in after the fact with the text function. There ought to
> be a better way.
>
> Thanks,
>
> David
Hi David,
Right now, your best approach is to use the text function. Just like
direct graphics (DG), there is currently no easy way to change the
font size of just the axis title.
One tip - if you use the /data keyword with the text function, then
you can specify the location in "data" coordinates, which might be a
bit simpler than normalized coordinates. Something like this:
p = Plot(/test)
yr = p.yrange
t = Text(mean(p.xrange),yr[0]-0.12*(yr[1]-yr[0]), 'X title', $
/DATA, ALIGNMENT=0.5, FONT_SIZE=1.25*p.font_size)
Hope this helps.
-Chris
ITTVIS
|
|
|