The following script draws a circle with a white border instead of a black one:
set terminal postscript eps
set output 'circlecolor.eps'
set object circle at first 0,0 radius first 1 lw 5 fs empty border lc rgb 'black' front
plot x lw 5
see the attached image. I could track this down to the commits of the 2013-09-26, but couldn't figure out where the problem actually is.
As best as I can figure it out, the problem comes down to a question of what the PostScript driver in "monochrome" mode should do with an rgb color spec.
Version 4.6 allowed an explicit RGB color to be drawn even in monochrome mode.
Version 5.0 does not except in the special case of "plot ... lc rgb variable".
In this case the circle is first filled with background color because of "fs empty" and then the border color is set. Except that in version 5 for a monochrome terminal the command to set the color is skipped if it's an RGB color.
One possible fix would be to adopt Henry Ford's policy: "any color you want so long as it's black". I.e. turn all RGB color requests into a request for black.
Another possible fix might be to go back to the 4.6 policy - any explicit request for an RGB color overrides the monochrome setting. Unfortunately at the deeper code levels it is not possible to tell whether a color request originated from an explicit request or whether it just happens that we're using linetype N which has at some point been assigned an RGB color.
Yet another possible fix would be to make object borders a special case. Even though colors in general are ignored in mono mode, we could allow object borders to force a color. I don't see a good argument for this other than it would be easier to implement than option 2 :-)
Last edit: Ethan Merritt 2014-06-12
While working with the new dashtype parameter, which makes the
solid|dashedterminal options superfluous, I was also thinking about the sense of thecolor|monochrometerminal options.Currently, using e.g.
set terminal pngcairo monochromeonly changes all default line colors to black. You'll also need to change the dashtypes with e.g.set for [i=1:8] lt i dt ito get reasonable line types. I'm not sure, what else the monochrome option affects (palette?). I tested with theset terminal pngcairo mono; set output 'test.png'; test palette, which seems to use thegraypalette, althoughshow palettestill reports the palette to beCOLOR.The reason for removing the
solid|dashedparameters was, that one can switch between the two settings withset for [i=1:8] lt i dt iandset for [i=1:8] lt i dt 'solid'.In my opinion, the same applies to the
color|monochromeoptions. To have all default lines black, one just must useset for [i=1:8] lt i lc -1. And, as I said above, you'll need to change the linetypes anyway to get dash patterns. But maybe I'm also missing something.I think, using the NTSC values for all colors, no matter how they were specified (palette, lc rgb, lt), would be my preferred solution. But I guess this would be a lot of work...
Alternatively, we could also use the lumonisity
Y = 0.2126 * R + 0.7152 * G + 0.0722 * B
to convert any color request to grayscale. The
windowsterminal currently does that ifmonooutput is requested. That way it is is easy to get a version for print-out.You can do that already by customizing one line (OK 3 lines) in the PostScript prologue. It doesn't require any changes in the gnuplot core code.
This used to be an FAQ, but maybe it hasn't been asked for a while.
%%% Uncomment the following lines to get ntsc greyscale coloring
% /ntsc { 0.114 mul exch 0.587 mul add exch 0.299 mul add } bind def
% /setrgbcolor {ntsc setgray} bind def
Last edit: Ethan Merritt 2014-06-12