bugGNU Octave - Bugs: bug #50217, Setting default graphics...

 
 

bug #50217: Setting default graphics properties for text has no effect

Submitter:  Georg Wiora <gwiora>
Submitted:  Fri 03 Feb 2017 09:58:17 AM UTC
   
 
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Invalid / Not an Octave Bug Assigned to:  None
Originator Name:  gwiora Open/Closed:  * Closed
Release:  * 4.2.0 Operating System:  * Microsoft Windows
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 03 Feb 2017 12:50:03 PM UTC, comment #2: 

Thank you very much for your explanations!

Georg Wiora <gwiora>
Fri 03 Feb 2017 12:28:07 PM UTC, comment #1: 

Hi,

Setting default properties for text objects does work for "regular" text objects:


set(0,'defaulttextfontsize',14)
set(0,'defaulttextfontname','Arial')
plot (1:10);
ht = text ();
get (ht, {"fontsize", "fontname"})
#-> ans = {14, "arial"}


Axes labels are handled differently: their properties are copied from their corresponding axes font* properties.
I checked in ML and it behaves the same way:


set(0,'defaulttextfontsize',14)
set(0,'defaulttextfontname','Arial')
plot (1:10)
xlabel('This is a test for a LABEL');
title('This is a test title!');
lab = get (gca, 'xlabel');
get (lab, 'FontSize')
%-> 11


So something like this will achieve what you want:


set(0,'defaultaxesfontsize',13)
set(0,'defaultaxesfontname','Arial')


This will set ticklabels size=13 and x(yz)labels size=14.3. The ratio between those(here 1.1) is given by the "label(title)fontsizemultiplier" property.

Closing report as invalid.

Pantxo Diribarne <pantxo>
Group Member
Fri 03 Feb 2017 09:58:17 AM UTC, original submission:  

Using the set(0,'default...') to set default values for text properties seems not hot have an effect, at least under qt.

Setting the following (for example in .octaverc) has no effect on new plots:

set(0,'defaulttextfontsize',14)
set(0,'defaulttextfontname','Arial')


Test it by calling

plot([1,2],[1,2]);
xlabel('This is a test for a LABEL');
title('This is a test title!');


The result is independent from the default values set. You can only influence the font setting by directly specifying 'fontname' and 'fontsize' properties in xlabel() and title().

Georg Wiora <gwiora>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-02-03 pantxo StatusNone Invalid / Not an Octave Bug
        Open/ClosedOpen Closed
    2017-02-03 gwiora Carbon-Copy- Added gwiora

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code