|
From: <jk...@ik...> - 2007-02-11 11:09:01
|
Jörgen Stenarson <jor...@bo...> writes:
> Saving a semilogy plot using the [pdf] backend the exponents come
> out wrong.
This seems to have something to do with the caching in
Text._get_layout_super(). The first script below works right, the
second has the exponents all wrong.
------------------------------------------------------------------------
#!/usr/bin/env python
import matplotlib
matplotlib.use('pdf')
from matplotlib import pylab
pylab.plot([0.001, 1, 10, 100, 1000])
pylab.gca().set_yscale('log')
pylab.savefig('foo1.pdf')
------------------------------------------------------------------------
#!/usr/bin/env python
import matplotlib
matplotlib.use('agg')
from matplotlib import pylab
pylab.plot([0.001, 1, 10, 100, 1000])
pylab.gca().set_yscale('log')
pylab.savefig('foo2.pdf')
------------------------------------------------------------------------
For some reason this doesn't happen with the eps backend, even though
it has flipy() == False, like pdf and unlike agg. Is there something
the pdf backend should do to reset the state of other objects when
switching to pdf from another backend?
> Looking at the source for the pdf-backend I also saw that it contains
> a mix of space and tabs for indentation.
Fixed in svn.
--
Jouni K. Seppänen
http://www.iki.fi/jks
|