xkcd

Hello.

I’ve only seen one way to use the xkcd feature. This uses a with statement.

Is there another way to use the xkcd feature so as to easily switch between exact plot and trembling one ?

Christophe BAL

That’s what the with statement allows you do.

Say you have a function that does some plotting and returns a figure – call it my_plot_func.

You can do:

fig1 = my_plot_func()

fig1.savefig(‘normal1.png’)

with plt.xkcd():

fig2 = mu_plot_func()

fig2.savefig(‘xkcd.png’)

fig2 = my_plot_func()

fig2.savefig(‘normal2.png’)

And the xkcd image will be squiggly but the normal images won’t.

-p

···

On Fri, Oct 3, 2014 at 12:40 PM, Christophe Bal <projetmbc@…287…> wrote:

Hello.

I’ve only seen one way to use the xkcd feature. This uses a with statement.

Is there another way to use the xkcd feature so as to easily switch between exact plot and trembling one ?

Christophe BAL


Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer

Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports

Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper

Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer

http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk


Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Also note, you can just call plt.xkcd() and it will turn on the setting globally for that session.

···

On 4 October 2014 00:11, Paul Hobson <pmhobson@…287…> wrote:

That’s what the with statement allows you do.

Say you have a function that does some plotting and returns a figure – call it my_plot_func.

You can do:

fig1 = my_plot_func()

fig1.savefig(‘normal1.png’)

with plt.xkcd():

fig2 = mu_plot_func()

fig2.savefig(‘xkcd.png’)

fig2 = my_plot_func()

fig2.savefig(‘normal2.png’)

And the xkcd image will be squiggly but the normal images won’t.

-p


Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer

Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports

Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper

Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer

http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk


Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users

On Fri, Oct 3, 2014 at 12:40 PM, Christophe Bal <projetmbc@…83…287…> wrote:

Hello.

I’ve only seen one way to use the xkcd feature. This uses a with statement.

Is there another way to use the xkcd feature so as to easily switch between exact plot and trembling one ?

Christophe BAL


Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer

Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports

Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper

Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer

http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk


Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users