- Manuel Scilab
- Bibliothèque graphique
- 2d_plot
- contour2di
- contourf
- errbar
- fec
- fgrayplot
- histplot
- paramfplot2d
- LineSpec
- Matplot
- Matplot1
- Matplot_properties
- Sfgrayplot
- Sgrayplot
- champ
- champ1
- champ_properties
- contour2d
- fchamp
- fcontour2d
- fec_properties
- fplot2d
- grayplot
- grayplot_properties
- graypolarplot
- oldplot
- plot
- plot2d
- plot2d1
- plot2d2
- plot2d3
- plot2d4
- plot2d_old_version
- polarplot
Please note that the recommended version of Scilab is 2026.0.0. This page might be outdated.
See the recommended documentation of this function
LineSpec
to quickly customize the lines appearance in a plot
Description
The LineSpec is an optional argument that can be used inside a plot command to customize each new line aspect. It has to be given as a concatenated string containing information about color, line style or markers. It is very usefull to quickly specify such basic line properties.
To specify a red longdash-dot with diamond marker, the string can be 'r-.diam'. As you can see, a full complete spelling of each property value is not required but the string, which is a concatenation (in any order) of these three types of properties , must remain unambiguous. Furthermore, the string specification is not case sensitive.
Here is a complete list of the LineSpec types you can
specify (using plot).
- LineStyle:
a string defining the line style. This property is linked to the object's
line_styleproperty (see polyline_properties).SpecifierLine Style-Solid line (default) --Dashed line :Dotted line -.Dash-dotted line - Color:
a string defining the line color. This property is linked to the object's
foregroundproperty (see polyline_properties).SpecifierColorrRed gGreen bBlue cCyan mMagenta yYellow kBlack wWhite A default color table is used to color plotted curves if you do not specify a color (neither with
LineSpecnor with GlobalProperty). When drawing multiple lines, the plot command automatically cycles through this table. Here are the used colors:RGB0. 0. 1. 0. 0.5 0. 1. 0. 0. 0. 0.75 0.75 0.75 0. 0.75 0.75 0.75 0. 0.25 0.25 0.25 - Marker type:
A string defining the marker type. note that if you specify a marker wihtout a line style, only the marker is drawn. This property is linked to the object's
mark_styleandmark_modeproperties (see polyline_properties).SpecifierMarker Type+Plus sign oCircle *Asterisk .Point xCross 'square'or's'Square 'diamond'or'd'Diamond ^Upward-pointing triangle vDownward-pointing triangle >Right-pointing triangle <Left-pointing triangle 'pentagram'Five-pointed star (pentagram) 'none'No marker (default)
Examples
x=1:0.1:10; // Init. plot(x,sin(x),'r.->') // plots a dash-dotted line with a right-pointing triangle centered on each points. clf(); // If you specify a marker wihtout a line style, only the marker is drawn plot(x,sin(x),'d') // plots a dash-dotted line with a right-pointing triangle centered on each points. x=1:10; // Init. // combinations' order does not matter plot(x,x.*x,'*cya--') //multiple plots with different LineSpecs clf(); t=0:%pi/20:2*%pi; plot(t,sin(t),'ro-.',t,cos(t),'cya+',t,abs(sin(t)),'--mo')
See Also
Authors
F.Leray
| << paramfplot2d | 2d_plot | Matplot >> |