bugGNU Octave - Bugs: bug #49775, Font characteristics of title via...

 
 

bug #49775: Font characteristics of title via command and via set do not match

Submitted by:  Dan Sebald <sebald>
Submitted on:  Tue 06 Dec 2016 04:01:18 AM UTC  
 
Category: PlottingSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Inaccurate Result
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Sun 18 Dec 2016 10:28:06 PM UTC, comment #7:

I pushed a modified patch on default:

http://hg.savannah.gnu.org/hgweb/octave/rev/509b2ef72225

Closing report as fixed.

Pantxo Diribarne <pantxo>
Project Member
Mon 12 Dec 2016 10:16:33 AM UTC, comment #6:

@Rik: yes I'll do that this week.

Pantxo Diribarne <pantxo>
Project Member
Mon 12 Dec 2016 05:51:21 AM UTC, comment #5:

@Panxto: I think you're right that the font properties in _axis_labels_.m can be removed. Do you want to update the patch?

Rik <rik5>
Project Administrator
Tue 06 Dec 2016 06:24:28 PM UTC, comment #4:

I attached a patch.

@Rik: with this in place I am under the impression that setting font* properties from _axis_labels_.m is not necessary anymore.

(file #39164)

Pantxo Diribarne <pantxo>
Project Member
Tue 06 Dec 2016 04:53:43 PM UTC, comment #3:

The list of axes props can be found here: http://www.mathworks.com/help/matlab/ref/axes-properties.html.

The Title property must contain a handle to a text object. In Matlab, you would do as Dan suggests and get the handle to the text object and then set fontsize, fontweight, etc. on the text object.

To be compatible, we could disallow the Octave-specific syntax of

but the syntax does seem convenient.

The text objects (like xlabel, title, ylabel) are created when the axes is initialized. We could probably default these objects to have

Rik <rik5>
Project Administrator
Tue 06 Dec 2016 08:59:25 AM UTC, comment #2:

Oh, this may not be a bug then. The title.m file does a set, but uses some extra parameters:

TitleFontSizeMultiplier and titlefontweight aren't something that set(gca, 'title', 'Nice Plot') can use in a generic sense.

I see that title() has an option where the axis handle can be passed in as the first argument. That's the proper way of controlling this, e.g.:

title(gca, 'hello', 'fontsize', 8)

The set(gca, 'title', '123') is more for directly tweaking the string parameters.

If there is one change to make, it might be that the default title settings for fontsize and fontweight are those listed above to match what the title does. But from there on, set(gca, 'title', '123') controls things.

What is a little odd is that the axis title is a handle, yet one is able to do

set(gca, 'title', 'world');

when it should maybe be

set(get(gca, 'title'), 'string', 'world');

Guess it's a shortcut, in a way.

Dan Sebald <sebald>
Tue 06 Dec 2016 08:03:28 AM UTC, comment #1:

Confirmed. Since being able to set directly the title string via the axes "title" property (a handle property) is an Octave only feature, we can't test this in ML.

I'll look into this and see what can be done.

Pantxo Diribarne <pantxo>
Project Member
Tue 06 Dec 2016 04:01:18 AM UTC, original submission:

Is the following a bug?

figure(1)
plot(1:50)
title('Hello')
figure(2)
plot(1:50)
set(gca,'title','World')

The title font weight and size do not match in the two plots.

Dan Sebald <sebald>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #39164:  initlabels.patch added by pantxo (5KiB - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by pantxo (Posted a comment)
  • -unavailable- added by sebald (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 18 Dec 2016 10:28:06 PM UTCpantxoStatusPatch Submitted=>Fixed
      Open/ClosedOpen=>Closed
    Tue 06 Dec 2016 06:24:38 PM UTCpantxoStatusConfirmed=>Patch Submitted
    Tue 06 Dec 2016 06:24:28 PM UTCpantxoAttached File-=>Added initlabels.patch, #39164
    Tue 06 Dec 2016 08:03:28 AM UTCpantxoStatusNone=>Confirmed

    Back to the top


    Powered by Savane 3.1-cleanup1