bugGNU Octave - Bugs: bug #49469, changing axes fontsize does not...

 
 

bug #49469: changing axes fontsize does not change labels too

Submitter:  L.Billmann <lbeducation>
Submitted:  Fri 28 Oct 2016 12:44:06 PM UTC
   
 
Category:  Plotting Severity:  3 - Normal
Priority:  3 - Low Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Fri 04 Nov 2016 05:57:05 PM UTC, comment #6: 

I pushed the patch on default.

Closing report.

Pantxo Diribarne <pantxo>
Group Member
Thu 03 Nov 2016 01:21:34 PM UTC, comment #5: 

I attached an updated patch that also lets one change the label/titlefontsizemultiplier and titlefontweight after the creation of labels and title.

(file #38877)

Pantxo Diribarne <pantxo>
Group Member
Thu 03 Nov 2016 12:42:56 PM UTC, comment #4: 

I changed the category to "plotting" since both gnuplot and opengl based toolkits are affected

Pantxo Diribarne <pantxo>
Group Member
Thu 03 Nov 2016 12:40:38 PM UTC, comment #3: 

I attached a patch.

(file #38875)

Pantxo Diribarne <pantxo>
Group Member
Mon 31 Oct 2016 08:43:55 PM UTC, comment #2: 

Ok, I realize that it is not of that importence now. I think I will choose workaround #2 specific for OCTAVE doing redesign of several programs to handle both target systems.
For me topic is more of interest cause I prefer resizable GUIs, so resizing is a typical job for all my gui object.

L.Billmann <lbeducation>
Fri 28 Oct 2016 03:27:51 PM UTC, comment #1: 

Yes, this is a known incompatibility.  There are two easy workarounds which has meant no great pressure to fix this.  I suspect that situation will continue for a while.

Workaround #1 :

Do all your plotting routines, change the axes fontsize, then do all the commands to annotate and make the plot beautiful such as adding labels and titles.


plot (1:10);
set (gca, "fontsize", 20);
xlabel ("x-axis label");
ylabel ("y-axis label");
title ("Title of plot");


Workaround #2 :

Change all the label fontsizes at the same time you change the axes fontsize.


set (gca, "fontsize", 20);
set (get (gca, "title"), "fontsize", 20);
set (get (gca, "xlabel"), "fontsize", 20);
set (get (gca, "ylabel"), "fontsize", 20);
## If you have zlabel, add this too
set (get (gca, "zlabel"), "fontsize", 20);


Workaround #3 :

Add a listener to the axes fontsize property which does what was done in Workaround #2.

function update_fontsize (h, ~)
  hlist = get (h, {"xlabel", "ylabel", "zlabel", "title"});
  new_fontsize = get (h, "fontsize");
  set ([hlist{:}], "fontsize", new_fontsize);
endfunction
addlistener (gca, "fontsize", @update_fontsize)

This isn't quite perfect because it doesn't respect LabelFontSizeMultiplier and TitleFontSizeMultiplier, but you get the idea.

Rik <rik5>
Group administrator
Fri 28 Oct 2016 12:44:06 PM UTC, original submission:  

When fonsize of an axes is changed, then only the tic numbers change their size but not the labels, title or legend.
This differs from MATLAB.
(graphics_toolkit = qt, so I suppose working with OpenGL)

L.Billmann <lbeducation>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #38877:  updatelabels.patch added by pantxo (4KiB - text/x-diff)
file #38875:  labels.patch added by pantxo (3KiB - text/x-diff)
file #38833:  result_MATLAB.png added by lbeducation (16KiB - image/png)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by pantxo (Updated the item)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by lbeducation (Submitted the item)
  • -email is unavailable- added by lbeducation
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 14 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-11-04 pantxo StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2016-11-03 pantxo Attached File- Added updatelabels.patch, #38877
    2016-11-03 pantxo CategoryPlotting with OpenGL Plotting
        StatusConfirmed Patch Submitted
        Operating SystemMicrosoft Windows Any
    2016-11-03 pantxo Attached File- Added labels.patch, #38875
    2016-10-28 rik5 Priority5 - Normal 3 - Low
        StatusNone Confirmed
        Release4.0.3 dev
    2016-10-28 lbeducation Attached File- Added axes_fontsize_change.m, #38832
        Attached File- Added result_MATLAB.png, #38833
        Attached File- Added result_OCTAVE_qt.png, #38834
        Carbon-Copy- Added lbeducation

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code