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 <projet...@gmail.com> 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
>
>
------------------------------------------------------------------------------
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