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

Home » Public Forums » archive » Re: NG font size for axis titles
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: NG font size for axis titles [message #72760] Fri, 08 October 2010 12:49
David Fanning is currently offline  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 Go to previous message
Matt Haffner is currently offline  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 Go to previous message
chris_torrence@NOSPAM is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: ITT VIS Website
Next Topic: Problem with Newsgroup?

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

Current Time: Wed Oct 08 15:12:08 PDT 2025

Total time taken to generate the page: 0.00506 seconds