Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.0.1 - 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 > 2d_plot > Matplot properties

Matplot properties

Description of the Matplot entities properties

Description

The Matplot entity is a leaf of the graphics entities hierarchy. It represents 2D plots of surface using colors and images (see Matplot and Matplot1).

parent

Graphic handle of the Matplot's parent, that should be of the type "Axes".

children

vector of children of the Matplot object. By default, a Matplot entity has no child, and .children is [].

visible

"on" (default) or "off". If "off", the Matplot patch is not displayed.

data

(m,n) matrix or (m,n,nc) hypermatrix of decimal, (u)int8, (u)int16, or (u)int32 numbers representing a matrix of (m,n) colors on nc = 1|3|4 channels to be plotted. The color encoding/decoding is set by the image_type property. The color associated to data(i,j,:) is used do draw and fill a small rectangle of fixed sizes touching its neighboors and centered at the (i,j) location.

rect

vector [xmin, ymin, xmax, ymax] defining a rectangle in data scales of the parent axes. The full data matrix is scaled accordingly to fill the rect shape:

  • Its m rows cover the [ymin, ymax] interval.
  • Its n columns cover the [xmin, xmax] interval.

The data(i,j) pixel is drawn in the small rectangle bounded by X = xmin + [j-1, j]*(xmax-xmin)/n and Y = ymax - [i-1, i]*(ymax-ymin)/m

If one rect bound goes beyond the corresponding .parent.data_bounds(i) axes bound, the overflowing side of the data matrix will be clipped, unless .clip_state is set to "off".

image_type

this field defines the image type. It could be one of the values: "index", "gray", "rgb", "rgba", "argb", "red", "green", "blue", "rgb332", "rgb444", "rgb555", "rgb4444", "rgb5551".

Colors are determinated by the data type and by image_type:

"index"
data are colors indices in the colormap.
"gray"
  • data as a matrix of int8 or uint8 provides Gray level color (R-G-B=GRAY-GRAY-GRAY).
  • Otherwise, data is considered as RGB levels and converted into gray colors (0.299*R+0.587*G+0.114*B).

"rgb"
  • data as an hypermat of int8 or uint8 provides the RGB components ;
  • data as an hypermat of doubles provides normalized RGB components (values between 0 and 1) ;
  • data as a matrix of int8 or uint8 with a number of rows multiple of 3 provides the RGB components ;
  • data as a matrix of int32 provides RGB colors ;
  • data as a matrix of uint32 provides RGBA colors where the alpha channel will be set to 0xFF.
"rgba"
  • data as an hypermat of int8 or uint8 provides the RGBA components ;
  • data as an hypermat of doubles provides normalized RGBA components (values between 0 and 1) ;
  • data as a matrix of int8 or uint8 with a number of rows multiple of 4 provides the RGBA components ;
  • data as a matrix of int32 or uint32 provides RGBA colors.
"argb"
  • data as an hypermat of int8 or uint8 provides the ARGB components ;
  • data as an hypermat of doubles provides normalized ARGB components (values between 0 and 1) ;
  • data as a matrix of int8 or uint8 with a number of rows multiple of 4 provides the ARGB components ;
  • data as a matrix of int32 or uint32 provides ARGB colors.
"red"
  • data as a matrix of int8 or uint8 provides Red level color (R-G-B=RED-00-00).
  • data of another type is considered as RGB intensities. They are then converted into red levels (a mask is applied to keep the Red component).
"green"
  • data as a matrix of int8 or uint8 provides Green level color (R-G-B=00-GREEN-00).
  • data of another type is considered as RGB intensities. They are then converted into green levels (a mask is applied to keep the Green component).
"blue"
  • data as a matrix of int8 or uint8 provides Blue level color (R-G-B=00-00-BLUE) ;
  • data of another type is considered as RGB intensities. They are then converted into blue levels (a mask is applied to keep the Blue component).
"rgb332"
  • data as a matrix of int8 or uint8 provides RGB colors where R component is wrote on 3 bits, G component on 3 bits and B component on 2 bits.
  • For other data types, RGB (8-8-8) data are converted into RGB (3-3-2).
"rgb444"
  • data as a matrix of int16 or uint16 provides RGB colors where each components is wrote on 4 bits.
  • For other data types, RGB (8-8-8) data are converted into RGB (4-4-4).
"rgb555"
  • data as a matrix of int16 or uint16 provides RGB colors where each components is wrote on 5 bits.
  • For other data types, RGB (8-8-8) data are converted into RGB (5-5-5).
"rgb4444"
  • data as a matrix of int16 or uint16 provides RGBA colors where each components is wrote on 4 bits.
  • For other data types, RGBA (8-8-8-8) data are converted into RGBA (4-4-4-4).
"rgb5551"
  • data as a matrix of int16 or uint16 provides RGBA colors where each non-alpha components is wrote on 5 bits and the alpha component on 1 bit.
  • For other data types, RGBA (8-8-8-8) data are converted into RGBA (5-5-5-1).
clip_state

Its value drives the clipping of the Matplot patch outside its parent Axes box. Possible values are:

  • "off": The Matplot patch is not clipped. Setting .clip_state = "off" automatically resets .clip_box = [].
  • "clipgrf": The Matplot patch is clipped outside its parent axes. Setting .clip_state = "clipgrf" automatically resets .clip_box = [].
  • "on": The Matplot patch is clipped outside the rectangle defined by the clip_box property.
clip_box

empty matrix [] (default) or [x,y,w,h] (upper-left point width height) bounds (in data scales) of the rectangular area outside which the Matplot patch must be clipped. Setting .clip_box = [x y w h] automatically sets .clip_state = "on".

user_data

this field can be use to store any scilab variable in the Matplot data structure, and to retrieve it.

tag

Single text that can be used as identifier/name of the Matplot object. findobj("tag", tag_value) will then return its full graphic handle.

Examples

nbcolors = size(gcf().color_map, 1);
Matplot(1:nbcolors)
e = gce(); // get current entity
e.data = e.data($:-1:1) // reverse order

See also

  • Matplot — 2D plot of a matrix using colors
  • Matplot1 — 2D plot of a matrix using colors
  • grayplot — 2D plot of a surface using colors
  • grayplot_properties — description of the grayplot entities properties
  • xrects — dessine ou remplit un ensemble de rectangles
  • graphics_entities — description of the graphics entities data structures

History

VersionDescription
5.5.0
  • Property image_type introduced.
  • Property rect introduced.
Report an issue
<< Matplot1 2d_plot paramfplot2d >>

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:
Mon Feb 12 19:15:32 CET 2018