description of the axes entity properties
The Axes entity is the second level of the graphics entities hierarchy. This entity defines the parameters allowing the change of coordinates and the axes drawing as well as the parameters’ default values for the children creation.
parent: | This field contains the handle of the parent figure. |
---|
: :x_location: Specify the location of the x-axis. The possible values are:
- “bottom”. In this case the x axis is drawn at the bottom of the axes rectangle.
- “top”. In this case the x axis is drawn at the top of the axes rectangle.
- “middle”. In this case the x axis is drawn at the centered position.
- “origin”. In this case the x axis is drawn at the origin.
: :y_location: Specify the location of the y-axis. The possible values are:
- “left”. In this case the y axis is drawn at the left of the axes rectangle.
- “right”. In this case the y axis is drawn at the right of the axes rectangle.
- “middle”. In this case the y axis is drawn at the centered position.
- “origin”. In this case the y axis is drawn at the origin.
: :font_color: This property determines the color of the tics labels. : :fractional_font: This property specify whether ticks labels are
displayed using fractional font sizes. Its value must be either “on” or “off”. If “on” the floating point value of font_size is used for display and the font is anti-aliased. If “off” only the integer part is used and the font is not smoothed.
:
: :Properties for high level functions The plot, plot2dx, grayplot and matplot functions use the following properties to decide how to merge consecutive plots if this is not stated by the frameflag calling argument. The result of the merge is decided through these two following properties:
auto_clear: If this property value is equal to “on”, a call to a high level graphic will re-ininitialize the current axes and erase all its children before preforming the drawing. If the value is “off” the drawings will be added to current axes according to “auto_scale” property.
- : :auto_scale: A property to update the axes data boundary. If value
- is “on”, a new plot will adapt the current axes properties to fit with previous and current plots. If its value is “off” the new plot will be drawn in the current axes data boundary.
:
hiddencolor: | This property controls the hidden parts’ color. It takes as value an index relative to the current colormap. In another case, if it is a negative value, the hidden parts take the same colors as the surface |
---|
: :clip_state: This field contains the default clip_state property value for all objects. Its value should be :
- “off” this means that all objects created after that are not clipped (default value).
- “clipgrf” this means that all objects created after that are clipped outside the Axes boundaries.
- “on” this means that all objects created after that are clipped outside the rectangle given by property clip_box.
:
:
:
`lines`_(0) // disables vertical paging
a=`get`_("current_axes")//get the handle of the newly created axes
a.axes_visible="on"; // makes the axes visible
a.font_size=3; //set the tics label font size
a.x_location="top"; //set the x axis position
a.data_bounds=[-100,-2,-1;100,2,1]; //set the boundary values for the x, y and z coordinates.
a.sub_tics=[5,0];
a.labels_font_color=5;
a.grid=[2,2];
a.box="off";
// Example with 3D axes
`clf`_(); //clear the graphics window
x=0.1:0.1:2*%pi;`plot2d`_(x-.3,`sin`_(x)*7+.2);
a=`gca`_(); // get the handle of the current axes
a.grid=[1 -1 -1]; //make x-grid
a.rotation_angles=[70 250]; //turn the axes with giving angles
a.grid=[1 6 -1]; //make y-grid
a.view="2d"; //return te the 2d view
a.box="back_half";
a.labels_font_color=5;
a.children.children.thickness=4;
a.children.children.polyline_style=3;
a.view="3d"; //return te the 3d view
a.children.children.thickness=1;
a.children.children.foreground=2;
a.grid=[1 6 3]; //make z-grid
a.parent.background=4;
a.background=7;
`plot2d`_(`cos`_(x)+1,3*`sin`_(x)-3);
`plot2d`_(`cos`_(x)+7,3*`sin`_(x)+3);
a.children(2).children.polyline_style=2;
a.children(1).children.polyline_style=4;
a.children(1).children.foreground=5;
a.children(2).children.foreground=14;
a.parent.figure_size= [1200,800];
a.box="on";
a.labels_font_size=4;
a.parent.background=8;
a.parent.figure_size= [400,200];
a.rotation_angles=[0 260];
`delete`_(a.children(2));
`delete`_(); // delete current object
a = `gca`_();
a.labels_font_size=1;
a.auto_clear= "on";
x=0:0.1:2.5*%pi;`plot2d`_(10*`cos`_(x),`sin`_(x));
a.data_bounds(:,1) = [1;15] ; // set positive bounds for X axe
a.log_flags = "lnn" ; // set X axes to logarithmic scale
a.log_flags = "nnn" ; // switch back to linear scale
a=`gca`_();
a.rotation_angles=[45 45];
a.data_bounds=[-20,-3,-2;20 3 ,2];
`xrect`_([-4 0.5 8 1]);
a.auto_clear = "off" ;
a.isoview="on"; // isoview mode
`xrect`_([-2 0.25 4 0.5]);
a.children(1).fill_mode="on";
a.axes_visible="off";
a.children(1).data=[-2 0.25 -1 4 0.5];
a.children(2).data=[-4 0.5 1 8 1];
x=2*%pi*(0:7)/8;
xv=[.2*`sin`_(x);.9*`sin`_(x)];yv=[.2*`cos`_(x);.9*`cos`_(x)];
`xsegs`_(10*xv,yv,1:8)
s=a.children(1);
s.arrow_size=1;
s.segs_color=5;
a.data_bounds //the boundary values for the x,y and z coordinates
a.view="2d";
a.data_bounds=[-10,-1; 10,1]; // set the boundary values for the two-dimensional views
// Example on axes model
da=`gda`_() // get the handle on axes model to view and edit the fields
// title by default
da.title.text="My Default@Title"
da.title.foreground = 12;
da.title.font_size = 4;
// x labels default
da.x_label.text="x";
da.x_label.text="x"; // Latex or MathML can be used here also
da.x_label.font_style = 8;
da.x_label.font_size = 2;
da.x_label.foreground = 5;
da.x_location = "middle";
// y labels default
da.y_label.text="y";
da.y_label.font_style = 3;
da.y_label.font_size = 5;
da.y_label.foreground = 3;
da.y_location = "right";
da.thickness = 2;
da.foreground = 7;
// the plot
x=(0:0.1:2*%pi)';
`plot2d`_(x,[`sin`_(x),`sin`_(2*x),`sin`_(3*x)],style=[1,2,3],rect=[0,-2,2*%pi,2]);
`sda`_() // back to default axes model
// Example with LaTeX / MathML ticks:
`plot2d`_();
a=`gca`_();
mathml="<mrow><mfrac><mrow><mi>d</mi> <mi>y</mi></mrow><mrow> <mi>d</mi> <mi>x</mi></mrow></mfrac> <mo>=</mo>..
<mfrac><mn>1</mn><msup> <mi>y</mi> <mn>2</mn></msup> </mfrac> </mrow>";
// Only LaTeX expression
a.x_ticks = `tlist`_(["ticks", "locations", "labels"], (0:6)', [mathml;"1";"$\sin(x)$";"3";"$\cos(a) - test$";"5";"6"]);
// Mixed expression: MathML and LaTex
a.y_ticks = `tlist`_(["ticks", "locations", "labels"], (-2:0.5:2)', ["0";"1";"2";"3";"$\cos(a)$";"5";"6";mathml;"8"]);
Version Description 5.4.0 line_style value 0 is obsolete, use 1 instead (both are equivalent for SOLID). Using value 0 will produce an error in Scilab 5.4.1. .. _get: get.html .. _segs_properties: segs_properties.html .. _graphics_entities: graphics_entities.html .. _grayplot_properties: grayplot_properties.html .. _sda: sda.html .. _polyline_properties: polyline_properties.html .. _label_properties: label_properties.html .. _set: set.html .. _Compound_properties: Compound_properties.html .. _fec_properties: fec_properties.html .. _surface_properties: surface_properties.html .. _champ_properties: champ_properties.html .. _scf: scf.html .. _axis_properties: axis_properties.html .. _gda: gda.html .. _gca: gca.html .. _getmark: getmark.html .. _gcf: gcf.html .. _graphics_fonts: graphics_fonts.html .. _rectangle_properties: rectangle_properties.html .. _LaTeX or MathML expression: math_rendering_features_in_graphic.html .. _text_properties: text_properties.html .. _sdf: sdf.html .. _lines: lines.html .. _plot2d: plot2d.html .. _plot: plot.html .. _legend_properties: legend_properties.html