01.02.2014 Views

GNUPlot Manual

GNUPlot Manual

GNUPlot Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

94 gnuplot 4.0 36 SET-SHOW<br />

36.57.5 Set style line<br />

Each terminal has a default set of line and point types, which can be seen by using the command test.<br />

set style line defines a set of line types and widths and point types and sizes so that you can refer to<br />

them later by an index instead of repeating all the information at each invocation.<br />

Syntax:<br />

set style line {linetype<br />

unset style line<br />

show style line<br />

| lt }<br />

{linewidth | lw }<br />

{pointtype | pt }<br />

{pointsize | ps }<br />

{palette}<br />

The line and point types are taken from the default types for the terminal currently in use. The line<br />

width and point size are multipliers for the default width and size (but note that here is<br />

unaffected by the multiplier given on set pointsize).<br />

The defaults for the line and point types is the index. The defaults for the width and size are both unity.<br />

Linestyles created by this mechanism do not replace the default styles; both may be used.<br />

Not all terminals support the linewidth and pointsize features; if not supported, the option will be<br />

ignored.<br />

Note that this feature is not completely implemented; linestyles defined by this mechanism may be used<br />

with plot, splot, replot, and set arrow, but not by other commands that allow the default index to<br />

be used, such as set grid.<br />

If gnuplot was built with pm3d support, the special keyword palette is allowed as linetype for splots<br />

(the 2d plot command ignores palette). In this case the line color is chosen from a smooth palette<br />

which was set previously with the command set palette. The color value corresponds to the z-value<br />

(elevation) of the splot.<br />

Example: Suppose that the default lines for indices 1, 2, and 3 are red, green, and blue, respectively, and<br />

the default point shapes for the same indices are a square, a cross, and a triangle, respectively. Then<br />

set style line 1 lt 2 lw 2 pt 3 ps 0.5<br />

defines a new linestyle that is green and twice the default width and a new pointstyle that is a half-sized<br />

triangle. The commands<br />

set style function lines<br />

plot f(x) lt 3, g(x) ls 1<br />

will create a plot of f(x) using the default blue line and a plot of g(x) using the user-defined wide green<br />

line. Similarly the commands<br />

set style function linespoints<br />

plot p(x) lt 1 pt 3, q(x) ls 1<br />

will create a plot of p(x) using the default triangles connected by a red line and q(x) using small triangles<br />

connected by a green line.<br />

splot sin(sqrt(x*x+y*y))/sqrt(x*x+y*y) w l pal<br />

creates a surface plot using smooth colors according to palette. Note, that this works only on some<br />

terminals.<br />

See also set palette (p. 85), set pm3d (p. 82).<br />

36.57.6 Plotting styles<br />

The commands set style data and set style function change the default plotting style for subsequent<br />

plot and splot commands.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!