octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [changeset] - x,y,zlabel/title respect axes font properties


From: Ben Abbott
Subject: Re: [changeset] - x,y,zlabel/title respect axes font properties
Date: Thu, 09 Oct 2008 15:17:25 -0400

On Thursday, October 09, 2008, at 10:38AM, "John W. Eaton" <address@hidden> 
wrote:
>On  9-Oct-2008, John W. Eaton wrote:
>
>| On  9-Oct-2008, John W. Eaton wrote:
>| 
>| | On  9-Oct-2008, Ben Abbott wrote:
>| | 
>| | | This changeset sets the font properties for the xlabel, ylabel,  
>| | | zlabel, and title in a manner consistent with Matlab.
>| | | 
>| | | Meaning as new axis labels are set via xlabel(), ylabel(), zlabel(),  
>| | | title() their font properties default to that of their parent axis.
>| | 
>| | | -
>| | | -    h = __go_text__ (ca, "string", txt, "rotation", rot, varargin{:});
>| | | +    h = __go_text__ (ca, "fontangle", get (gca, "fontangle"),
>| | | +                         "fontname", get (gca, "fontname"),
>| | | +                         "fontsize", get (gca, "fontsize"),
>| | | +                         "fontunits", get (gca, "fontunits"),
>| | | +                         "fontweight", get (gca, "fontweight"),
>| | | +                         "string", txt, "rotation", rot, varargin{:});
>| | 
>| | If you are inheriting from the parent axes object, then shouldn't you
>| | get the properties from CA instead of GCA()?
>| 
>| Oops.  Never mind.  I should have actually looked at the function
>| before firing off the email.  In any case, since CA is already set to
>| GCA() earlier in this function, it makese sense to use CA to avoid
>| multiple calls to GCA().
>| 
>| I applied the changeset with this additional change.
>
>OK, one more question (sorry for not being completely awake yet).
>
>Now I'm wondering why this patch is even needed.  Shouldn't all
>objects inherit all appropriate properties from their parents?  If so,
>then the axis_label function seems liek the wrong place to do this,
>and it seems bad that we would have to enumerate the properties that
>are inherited instead of just having this happen automatically at some
>lower level, when the text object is created.
>
>jwe
>

I had originally thought this would be handled at a lower level, but when I 
played with Matlab, I was no longer sure.

In Matlab ...

 figure
 xlabel('Hello')

Produces a xlabel with the font properties of the axis. If this if followed by 
...

 set(get(gca,'xlabel'),'fontsize',20)

The font changes to 20pt. If then followed by ...

 xlabel('Hello')

The font size is again inherited from the parent axis. However, if this is 
followed by ...

 set(get(gca,'xlabel'),'fontsize',20)
 set(get(gca,'xlabel'),'string','Hello Again')

The font size remains 20pt.

Based upon this I assumed that a low level didn't look as attractive to me as 
placing the solution in __axis_label__.

Also, the text objects do not inherit their font properties from the axis 
(unfortunately). Which means the axis labels and title must be handled 
differently from text.

Thus, I concluded the best place for this was in __axis_label__.

However, my judgement of the c++ side is suspect, so perhaps I'm off base here.

Ben




reply via email to

[Prev in Thread] Current Thread [Next in Thread]