convert figure from color to BW/grayscale

Eli Brosh <ebrosh1@...287...> writes:

I need to prepare two versions of figures: color and BW(Black&White).
Is there an easy way to produce just the colored version and than use some
command or script to turn it to BW or grayscale?

For some really simple plots, and for pdf output only, you can try

rc('pdf', inheritcolor=True)

This produces a (possibly invalid) PDF file that doesn't set any colors,
and will usually be rendered in black on white. I implemented this in
response to a request to be able to inherit the current foreground color
in pdfLaTeX: if you set the color to e.g. red and include such a file,
it will be rendered in red.

This was quite some time ago, and matplotlib now has more drawing
primitives, not all of which work sensibly with this option. In some
examples you get all-black images, in some you get color in one part of
the image. But I guess this option only ever made sense for pretty
simple line drawings.


Jouni K. Sepp�nen