On Wed, Sep 23, 2009 at 10:48 AM, Jouni K. Seppänen <j...@iki.fi> wrote:
> Andrew Straw <straw...@astraw.com> writes:
>
>> Jouni - I don't think this would be hard to add, but I'm swamped at
>> work. If this is an itch you'd like to scratch, feel free to hack away
>> on the image_comparison() function in
>> lib/matplotlib/testing/decorators.py -- it's a pretty straightforward
>> piece of code.
>
> Changing that is probably easy enough, but how should the overall code
> path look?
>
> I was planning to switch backends in matplotlib.test after it runs the
> Agg tests, so that the same test cases could be used to produce pdf
> files (that's why they save files without extensions, right?) but this
> seems to be impossible. The matplotlib.use function is a no-op if
> matplotlib.backends has been imported, regardless of the warn argument.
> For example, the following code produces two png files:
>
>    #!/usr/bin/env python
>    import matplotlib
>
>    matplotlib.use('agg')
>    from matplotlib import pyplot
>    pyplot.plot([3,1,4,1])
>    pyplot.savefig('foo1')

Take a look at the pyplot "switch_backends" function.

Alternatively, agg knows how to save pdf if given the extension, so we
could wire up the testing to use a module level extension set
somewhere which could be updated for each backend.  This is probably
safer and cleaner than switch_backends

JDH

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to