[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
3.25.32 linetype
The ‘set linetype‘ command allows you to redefine the basic linetypes used for plots. The command options are identical to those for "set style line". Unlike line styles, redefinitions by ‘set linetype‘ are persistent; they are not affected by reset.
For example, linetypes one and two default to red and green. If you redefine them like this:
set linetype 1 lw 2 lc rgb "blue" pointtype 6 set linetype 2 lw 2 lc rgb "forest-green" pointtype 8
everywhere that uses lt 1 will now get a thick blue line rather than a thin red line (the previous default meaning of lt 1). This includes uses such as the definition of a temporary linestyle derived from the base linetype 1.
‘Note‘: This command is new to gnuplot version 4.6. It supersedes a rather cryptic command in version 4.2 "set style increment user". The older command is now deprecated.
This mechanism can be used to define a set of personal preferences for the sequence of lines used in gnuplot. The recommended way to do this is to add to the run-time initialization file ~/.gnuplot a sequence of commands like
if ((GPVAL_VERSION < 4.5) \ || (!strstrt(GPVAL_COMPILE_OPTIONS,"+USER_LINETYPES"))) \ exit set linetype 1 lc rgb "dark-violet" lw 2 pt 0 set linetype 2 lc rgb "sea-green" lw 2 pt 7 set linetype 3 lc rgb "cyan" lw 2 pt 6 pi -1 set linetype 4 lc rgb "dark-red" lw 2 pt 5 pi -1 set linetype 5 lc rgb "blue" lw 2 pt 8 set linetype 6 lc rgb "dark-orange" lw 2 pt 3 set linetype 7 lc rgb "black" lw 2 pt 11 set linetype 8 lc rgb "goldenrod" lw 2 set linetype cycle 8
Every time you run gnuplot the line types will be initialized to these values. You may initialize as many linetypes as you like. If you do not redefine, say, linetype 3 then it will continue to have the default properties (in this case blue, pt 3, lw 1, etc). The first few lines of the example script insure that the commands will be skipped by older versions of gnuplot.
Similar script files can be used to define theme-based color choices, or sets of colors optimized for a particular plot type or output device.
The command ‘set linetype cycle 8‘ tells gnuplot to re-use these definitions for the color and linewidth of higher-numbered linetypes. That is, linetypes 9-16, 17-24, and so on will use this same sequence of colors and widths. The point properties (pointtype, pointsize, pointinterval) are not affected by this command. ‘unset linetype cycle‘ disables this feature. If the line properties of a higher numbered linetype are explicitly defined, this takes precedence over the recycled low-number linetype properties.
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on April 4, 2012 using texi2html 5.0.