ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Mojca Miklavec <mojca.miklavec.lists@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: gnuplot module: `option=monochrome` does not work.
Date: Tue, 13 Dec 2011 19:23:25 +0100	[thread overview]
Message-ID: <CALBOmsZk7Q1V44CSbeTBNJ3HUmenBuV2MDZD2UV86b6gKdkswg@mail.gmail.com> (raw)
In-Reply-To: <1323795790.7004.40.camel@mattotaupa>

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
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2011-12-13 18:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-13 17:03 Paul Menzel
2011-12-13 18:23 ` Mojca Miklavec [this message]
2011-12-13 18:32   ` Mojca Miklavec

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CALBOmsZk7Q1V44CSbeTBNJ3HUmenBuV2MDZD2UV86b6gKdkswg@mail.gmail.com \
    --to=mojca.miklavec.lists@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).