graphics_entities - description of the graphics entities data structures
new graphics - description of the graphics entities data structures
figure_style - description of the graphics entities data structures
old_style - description of the graphics entities data structures
Scilab graphics is based on two differents modes. In the "old" mode, the graphics functions are stored to enable redisplay, zoom and rotations. In the "new" mode, each graphics window and the drawing it contains are represented by hierchical entities. The hierachy top level is the Figure. Each Figure defines at least one child of type Axes. Each Axes entity contains a set of leaf entities which are the basic graphics objects like Polylines, Rectangles, Arcs, Segs,... It can also contain an Compound type which are recursive sets of entities. The main interest of the new graphic mode is to make property change easier. This new graphics'mode provides a set of high-level graphing routines (see set , get ) used to control objects' properties such as data, coordinates and scaling, color and appearences without requiring to replay the initial graphics commands.
Graphics entities are associated to Scilab variables of type handle . The handle is a unique identifier which is associated to each instance of a created graphical entity. Using this handle, it will be possible to reach entities' properties through "set" and "get" routines. The handles are also used to manipulate graphics objects, to move them, to make copies or delete them.
To set the current graphics window mode we can use these following instructions: set("figure_style","new") to have a graphics window under the "new" mode or set("figure_style","old ") for the "old" mode.
The instructions set("old_style","off") and set("old_style","on") are used to set the default mode to be used when a new graphics window is created.
The handle on the current figure (the figure used where the drawing are sent) may be got using get("current_figure") and it may be set using set("current_figure",h) , where h is either a handle on a figure or a figure_id in this last case if the figure does not already exists , it is created
See figure_properties for details.
The Axes entity is the second level of the graphics entities hierarchy. This entity defines the parameters for the change of coordinates and the axes drawing as well as the parameters' default values for its children creation. See axes_properties for details. The handle on the current Axes may be got using get("current_axes") .
See glue , unglue and Compound_properties functions.
See axis_properties for details.
See polyline_properties for details.
See arc_properties for details.
See rectangle_properties for details.
See surface_properties for details.
See fec_properties for details.
See grayplot_properties for details.
See Matplot_properties for details.
See segs_properties for details.
See champ_properties for details.
See text_properties for details.
See label_properties for details.
See legend_properties for details.
//Play this example line per line set("figure_style","new") //create a figure in entity mode //get the handle on the Figure entity and display its properties f=get("current_figure") a=f.children // the handle on the Axes child x=(1:10)'; plot2d(x,[x.^2 x.^1.5]) e=a.children //Compound of 2 polylines p1=e.children(1) //the last drawn polyline properties p1.foreground=5; // change the polyline color e.children.thickness=5; // change the thickness of the two polylines delete(e.children(2)) move(e.children,[0,30]) //translate the polyline a.axes_bounds=[0 0 0.5 0.5]; subplot(222) //create a new Axes entity plot(1:10); a1=f.children(1); //get its handle copy(e.children,a1); //copy the polyline of the first plot in the new Axes a1.data_bounds=[1 0;10 100]; //change the Axes bounds set("current_figure",10) //create a new figure with figure_id=10 plot3d() //the drawing are sent to figure 10 set("current_figure",f) //make the previous figure the current one plot2d(x,x^3) //the drawing are sent to the initial figure
set , get , move , draw , delete , object_editor , plot , surf ,