Syntax:
with <style> { {linestyle | ls <line_style>} | {{linetype | lt <line_type>} {linewidth | lw <line_width>} {linecolor | lc <colorspec>} {pointtype | pt <point_type>} {pointsize | ps <point_size>} {arrowstyle | as <arrowstyle_index>} {fill | fs <fillstyle>} {fillcolor | fc <colorspec>} {nohidden3d} {nocontours} {nosurface} {palette}} }
where 4#4style5#5 is one of
lines dots steps vectors yerrorlines points impulses fsteps xerrorbar xyerrorbars linespoints labels histeps xerrorlines xyerrorlines financebars surface arrows yerrorbar parallelaxesor
boxes boxplot ellipses histograms rgbalpha boxerrorbars candlesticks filledcurves image rgbimage boxxyerror circles fillsteps pm3d polygons isosurface zerrorfillor
table
The first group of styles have associated line, point, and text properties. The second group of styles also have fill properties. See fillstyle (p. ). Some styles have further sub-styles. See plotting styles (p. ) for details of each. The table style produces tabular output rather than a plot. See set table (p. ).
A default style may be chosen by set style function and set style data.
By default, each function and data file will use a different line type and point type, up to the maximum number of available types. All terminal drivers support at least six different point types, and re-use them, in order, if more are required. To see the complete set of line and point types available for the current terminal, type test (p. ).
If you wish to choose the line or point type for a single plot, 4#4line_type5#5 and 4#4point_type5#5 may be specified. These are positive integer constants (or expressions) that specify the line type and point type to be used for the plot. Use test to display the types available for your terminal.
You may also scale the line width and point size for a plot by using 4#4line_width5#5 and 4#4point_size5#5, which are specified relative to the default values for each terminal. The pointsize may also be altered globally — see set pointsize (p. ) for details. But note that both 4#4point_size5#5 as set here and as set by set pointsize multiply the default point size — their effects are not cumulative. That is, set pointsize 2; plot x w p ps 3 will use points three times default size, not six.
It is also possible to specify pointsize variable either as part of a line style or for an individual plot. In this case one extra column of input is required, i.e. 3 columns for a 2D plot and 4 columns for a 3D splot. The size of each individual point is determined by multiplying the global pointsize by the value read from the data file.
If you have defined specific line type/width and point type/size combinations with set style line, one of these may be selected by setting 4#4line_style5#5 to the index of the desired style.
Both 2D and 3D plots (plot and splot commands) can use colors from a smooth palette set previously with the command set palette. The color value corresponds to the z-value of the point itself or to a separate color coordinate provided in an optional additional using colymn. Color values may be treated either as a fraction of the palette range (palette frac) or as a coordinate value mapped onto the colorbox range (palette or palette z). See colorspec (p. ), set palette (p. ), linetype (p. ).
The keyword nohidden3d applies only to plots made with the splot command. Normally the global option set hidden3d applies to all plots in the graph. You can attach the nohidden3d option to any individual plots that you want to exclude from the hidden3d processing. The individual elements other than surfaces (i.e. lines, dots, labels, ...) of a plot marked nohidden3d will all be drawn, even if they would normally be obscured by other plot elements.
Similarly, the keyword nocontours will turn off contouring for an individual plot even if the global property set contour is active.
Similarly, the keyword nosurface will turn off the 3D surface for an individual plot even if the global property set surface is active.
The keywords may be abbreviated as indicated.
Note that the linewidth, pointsize and palette options are not supported by all terminals.
Examples:
This plots sin(x) with impulses:
plot sin(x) with impulses
This plots x with points, x**2 with the default:
plot x w points, x**2
This plots tan(x) with the default function style, file "data.1" with lines:
plot [ ] [-2:5] tan(x), 'data.1' with l
This plots "leastsq.dat" with impulses:
plot 'leastsq.dat' w i
This plots the data file "population" with boxes:
plot 'population' with boxes
This plots "exper.dat" with errorbars and lines connecting the points (errorbars require three or four columns):
plot 'exper.dat' w lines, 'exper.dat' notitle w errorbars
Another way to plot "exper.dat" with errorlines (errorbars require three or four columns):
plot 'exper.dat' w errorlines
This plots sin(x) and cos(x) with linespoints, using the same line type but different point types:
plot sin(x) with linesp lt 1 pt 3, cos(x) with linesp lt 1 pt 4
This plots file "data" with points of type 3 and twice usual size:
plot 'data' with points pointtype 3 pointsize 2
This plots file "data" with variable pointsize read from column 4
plot 'data' using 1:2:4 with points pt 5 pointsize variable
This plots two data sets with lines differing only by weight:
plot 'd1' t "good" w l lt 2 lw 3, 'd2' t "bad" w l lt 2 lw 1
This plots filled curve of x*x and a color stripe:
plot x*x with filledcurve closed, 40 with filledcurve y=10
This plots x*x and a color box:
plot x*x, (x>=-5 && x<=5 ? 40 : 1/0) with filledcurve y=10 lt 8
This plots a surface with color lines:
splot x*x-y*y with line palette
This plots two color surfaces at different altitudes:
splot x*x-y*y with pm3d, x*x+y*y with pm3d at t