|
From: Benjamin R. <ben...@ou...> - 2010-09-20 18:15:35
|
On Mon, Sep 20, 2010 at 1:01 PM, Eli Brosh <eb...@gm...> wrote:
> OK,
> This worked for me for turning the figure to black and white:
> After saving the figure in colors I write
>
> fig=gcf()
>
> for o in fig.findobj(matplotlib.lines.Line2D):
> o.set_color('k')
>
> for o in fig.findobj(matplotlib.text.Text):
> o.set_color('k')
>
> Than I save it as black and white.
>
> It is beyond my programming skills, but I wish we could have a built in
> function of this type.
> Perhaps as:
>
> Fig_BW=makeBW(fig)
>
> Regards,
> Eli
>
>
>
Eli,
I am glad that worked for you. Ultimately, Friedrich's approach will make
it into a released version of matplotlib so that making a figure into a
black and white figure will be something as simple as
fig.set_gray(True)
Which, I hope, will satisfy your needs in the future.
Ben Root
|