Credits | Overview | Plotting Styles | Commands | Terminals |
---|
The previous example illustrated use of background-filled marks where the mark polygon inherits the color of the line it is part of. This example shows how the fill color and border color of such a mark can be varied separately. Note that
The data plotted in these examples is taken from iris.dem For simplicity, data preprocessing to generate separate datablocks $setosa, $versicolor, $virginicana is not shown here.
array Square = [{-0.5,-0.5}, { 0.5,-0.5}, { 0.5, 0.5}, {-0.5, 0.5}, {-0.5,-0.5}] $Triangle << EOD 0 0.5 0.433013 -0.25 -0.433013 -0.25 0 0.5 EOD
set mark 1 Square using 2:3 set mark 2 $Triangle using 1:2 set mark 3 $Triangle using 1:(-$2)
The first plot shows that if no fillstyle is provided in either the mark definition or the plot command, it is inherited from the global properties in set style fill. If no fillcolor is provided, it follows the default sequence of plot colors.
set object 1 rectangle from graph 0,0 to graph 1,1 set object 1 fillstyle solid fc "gray" behind
set title "White outline with solid color fill" set style fill solid border lc 'white'
plot $setosa with marks mt 1 ps 1.5 title "setosa", \ $versicolor with marks mt 2 ps 2 title "versicolor", \ $virginica with marks mt 3 ps 2 title "virginica"
The second plot provides both a fillcolor and a stroke color in the plot command. The key entries then need a different fill color.
set style fill solid plot $setosa with marks mt 1 ps 1.5 lw 2 notitle \ fc "gray" fs border lc '#1f77b4', \ $versicolor with marks mt 2 ps 2 lw 2 notitle \ fc "gray" fs border lc '#ff7f0e', \ $virginica with marks mt 3 ps 2 lw 2 notitle \ fc "gray" fs border lc '#2ca02c', \ keyentry with marks mt 1 ps 1.5 lw 2 \ fc bgnd fs border lc '#1f77b4' \ title "setosa", \ keyentry with marks mt 2 ps 2 lw 2 \ fc bgnd fs border lc '#ff7f0e' \ title "versicolor", \ keyentry with marks mt 3 ps 2 lw 2 \ fc bgnd fs border lc '#2ca02c' \ title "virginica"