Plotting points with lt nodraw
selects a line color which depends on the position in the plot command.
Consider the following command:
set terminal pngcairo set output 'points-nodraw.png' set object rectangle from screen 0,0 to screen 1,1 fc rgb 'green' fillstyle solid noborder behind set samples 11 unset tics set multiplot layout 2,2 set title 'lt nodraw on 2.' plot x with lines lt nodraw, x with points lt nodraw pt 7 ps 2 unset object set title 'lt nodraw on 3.' plot x with lines lt nodraw, x with lines lt nodraw, x with points lt nodraw pt 7 ps 2 set title 'lt nodraw' plot x with points pt 7 ps 2 lt nodraw, 2 * x with lines lt nodraw lw 3 set title 'lt -2' plot x with points pt 7 ps 2 lt -2, 2 * x with lines lt -2 lw 3 unset multiplot
I attached the output. Other terminals show the same behavior.
Shouldn't lt -2
and lt nodraw
behave the same?
Another, related thought: shouldn't
plot x with points lt -2
skip the points? I see, that using e.g. plot x with linespoints lt nodraw
might behave differently, but should that hold also when plotting only points?
The first three panels in your example produce exactly the result I would have expected. "nodraw" is a linetype, not a color. The color still has to come from somewhere, and the usual case is to take it from the linetype matching the sequence in the plot. That is what happens here.
If you modify the plot commands to use
with linespoints lt nodraw lc 'cyan'
then the color will come from the lc keyword rather than from the plot sequence, but the linetype will still be "nodraw".
The idea was to provide keywords ("bgnd" "black" "nodraw") rather than the mysterious negative linetype numbers.
I don't know what's going on with the 4th panel (lt -2).
... checking ...
Aha. In misc.c line 1060
Maybe it should not do load_linetype for negative linetypes?
Or maybe it should reset the linetype afterwards?
I'm not sure, but in any case that is the point of difference between giving lt -2 and lt nodraw.
I was still stuck at the point, that one could use
lt
insideset linetype
, in which case thelt
actually specified the color, and only that. I've seen now, thatset linetype
doesn't accept this anymore, good :)Seeing this, I also think, that your solution to allow plotting only points with the
linespoints
plotting style, which you gave in #1374 4.65 Do not plot points when linewidth is set to 0 for linepoints doesn't work as proposed:gives the error
linetype definition cannot use linetype
. So, the whole purpose of treatingwith points lt nodraw
differently fromwith lines lt nodraw
doesn't work that way.And, what actually confused me was this special treatement of
lt nodraw
, which contradicts its intuitive meaning (draws points although it saysnodraw
). And the linetype contains the definition of points and lines, so why should it behave differently depending on the selected plotting style?