Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.1.0 - Français

Change language to:
English - 日本語 - Português - Русский

Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
See the recommended documentation of this function

Aide de Scilab >> Graphiques > annotation > Label entity properties

Label entity properties

Properties of Axes labels and title

Description

Label entities are used as Axes.x_label, Axes.y_label, Axes.z_label, and Axes.title coumpound properties. They are therefore addressed through any Axes handle as for instance returned by gca(). gda() settings allow to define the default values of their properties.

Label entities cannot be directly deleted.

Their properties are the following:

parent:

Handle of the parent Axes.

visible:

"on" | "off". If "off" the label (and its box) still exists but is not displayed.

text:

Matrix of texts of the label. So, a label can have multiple rows or/and columns of text. Leading and trailing blanks are trimmed. In their columns, texts are left-justified. LaTeX expressions delimited with "$...$" are supported.

font_foreground:

Color used to display the .text of the label. It is specified by its index in the current colormap (or -1 for black, -2 for white)

foreground:

Color used to display the border of the box surrounding the block of .text, if any. It is specified by its index in the current colormap, or -1 for black or -2 for white. It is ignored if .fill_mode="off".

background:

Color used to fill the box surrounding the block of text, if any. It is specified by its index in the current colormap, or -1 for black or -2 for white. It is ignored if .fill_mode="off".

fill_mode:

This is actually a "box mode" property. "on" draws a box around the block of text of the label. Otherwise, no block's edge is drawn. The .foreground value is the color's index of the edge. The .background value is the index of the filling color.

font_style:

Integer id ≥ 0 identifying the font used to display the label, among loaded ones. = rank of the font in the vector listed with xlfont()', - 1. For more information, see graphics_fonts.

font_size:

Scalar positive number specifying the size of displayed characters. If .fractional_font property is "off" only the integer part of the .font_sizevalue is used. For more information see graphics_fonts.

fractional_font:

"on" |"off". When it is "off", only the integer part of the .font_size is considered. When it is "on", the font is scaled and the display of the text is anti-aliased (smoothed).

font_angle:

Clockwise angle of the label's block, in degrees, horizontal = 0°. The lower-left corner of the horizontal box is used as pivot (fixed point). Setting .font_angle automatically sets .auto_rotation="off".

auto_rotation:

If "on", Scilab sets automatically the best label's orientation. Then the .font_angle value is not taken into account. If "off", the orientation is set according to the .font_angle value.

position:

Vector of coordinates of the label's anchor, in data unit. The anchor is the lower-left corner of the horizontal box of the label. Setting the .position automatically sets .auto_position="off".

auto_position:

If "on", Scilab sets automatically the best label's position. If "off", the value of the .position property is used.

Examples

a=get("current_axes");
a.title
type(a.title)
plot3d()
a.x_label
a.y_label
a.z_label
xtitle("My title","my x axis label", "Volume","Month")

t=a.title;
t.foreground=9;
t.font_size=4;
t.font_style=5;
t.text="SCILAB";

x_label=a.x_label;
x_label.text=" Weight"
x_label.font_style= 5;
a.y_label.foreground = 12;

// Labels written in LaTeX or MathML can be used:
t.text = "$\sqrt{SCILAB}$";
x_label.font_size= 5;
x_label.text="<mrow><mfrac><mrow><mn>1</mn></mrow><mrow><mn>2</mn></mrow></mfrac><mo></mo><mfenced open=""{"" close=""}"">" + ...
"<mrow><mfrac><mrow><mfrac><mrow><mi>a</mi></mrow><mrow><mi>b</mi></mrow></mfrac></mrow><mrow><mfrac><mrow><mi>c</mi></mrow><mrow><mi>d</mi></mrow>" + ...
"</mfrac></mrow></mfrac></mrow></mfenced></mrow>"

See also

  • xlabel ylabel zlabel — sets or updates the x-axis label or/and its properties
  • xtitle — add titles on a graphics window
  • title — displays a title above a graphic axes, or updates its properties.
  • xstring — dessine des chaînes de caractères
  • xlfont — load a font in the graphic context or query loaded font
  • color — returns the color id of a color
  • set — set properties of some graphic objects or uimenus or uicontrol interactive components
  • text_properties — description of the Text entity properties
  • axes_properties — description of the axes entity properties

History

VersionDescription
5.2 LaTeX expressions delimited with "$..$" are now supported
Report an issue
<< captions annotation legend >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue Feb 25 08:50:26 CET 2020