gnuplot module: `option=monochrome` does not work.
Dear ConTeXt folks, I want to create monochrome plots, but `option=monochrome` is ignored. \usemodule[gnuplot] \setupGNUPLOT[terminal=context,option=monochrome] \startGNUPLOTscript[pi] plot pi t '$π = \ctxlua{context(math.pi)}$' \stopGNUPLOTscript \starttext \useGNUPLOTgraphic[pi] \blank \CONTEXT\ \contextmark\ \contextversion \stoptext Is that the correct way to enable monochrome output? Looking at the Wiki page [1] it should be something like the above. Am I doing something wrong? Thanks, Paul [1] http://wiki.contextgarden.net/Gnuplot
On Tue, Dec 13, 2011 at 18:03, Paul Menzel wrote:
Dear ConTeXt folks,
I want to create monochrome plots, but `option=monochrome` is ignored.
(Ashamed.) Yes, you are right.
\usemodule[gnuplot]
\setupGNUPLOT[terminal=context,option=monochrome]
This passes the option to terminal if no better way is available. This would only help you in case of png, pdf or metapost terminal. For ConTeXt terminal in input mode it wouldn't help you since the option color/dashed/etc. are completely ignored. This means that gnuplot will only consider options fontscale=, points=metapost|tex, width= and height= since that influences the output. Colors and dashed/solid lines can be turned on and off on the fly, same for line widths (you can redraw the same graph with dash turned on and off, using the same gnuplot output). First of all, I should fix documentation on that (using it that way is slightly deprecated and should only be used if the option is not). But second of all .. I just realized that, for example, standalone mode writes out \setupGNUPLOTterminal [context] [linejoin=mitered, % *mitered* | rounded | beveled linecap=butt, % *butt* | rounded | squared dashed=yes, % *yes* | no dashlength=1, % scaling factor for dash lengths linewidth=1, % scaling factor for line widths (1.0 means 0.5bp) %fontscale=1, % scaling factor for text labels points=metapost, % *metapost* | tex (Should points be drawn with MetaPost or TeX?) images=inline] % *inline* | external (inline only works in MKIV, external requires png support in gnuplot) but I completely forgot about monochrome option!!! Or rather ... I see that I print out "\setupcolors[state=start]" if and only if color is switched on, but that won't really help you in standalone mode. Ouch! I'm sorry. You don't need to recompile the terminal for that, but I need to fix t-gnuplot.tex and mp-gnuplot.mp. Does, according to what you see above, "color=yes|no" make sense? (I will also have to change the terminal for standalone mode, but that won't affect your plots.) However, the main reason why I didn't do it better before is because I have no idea what to do with monochrome. That is: should I use different shades of gray? Should I simply make all the colors solid black? And then the user should use "color=no,dashed=yes"? I'm particularly confused about the choice between different shades of gray and black. And yes - I'll fix the wiki page. Here's a quick workaround: \startMPextensions gp_color_lt[0] := black; gp_color_lt[1] := black; gp_color_lt[2] := black; gp_color_lt[3] := black; gp_color_lt[4] := black; gp_color_lt[5] := black; gp_color_lt[6] := black; gp_color_lt[7] := black; gp_color_lt[8] := black; \stopMPextensions Mojca
Dear Paul, Just a few more thoughts: - If your whole document is black-and-white (if you switch colors off globally), the plot will turn out black-and-white anyway (actually it will be different shades of gray). - You can always use something like plot pi lt 1 lc 0, 2*pi lt 2 lc 0 or lc rgb "black" (if I'm not mistaken about the syntax) or set style line 1 lt 1 lc 0 set style line 2 lt 2 lc 0 plot sin(x) ls 1, cos(x) ls 2, ... Mojca
participants (2)
-
Mojca Miklavec
-
Paul Menzel