pdf backend bug with logarithmic plots #804

jkseppan opened this Issue Mar 28, 2012 · 2 comments


None yet

1 participant


Reported by "sanders" at http://thread.gmane.org/gmane.comp.python.matplotlib.general/30305

The second pdf file produced by the following script looks wrong, as if one corner of each histogram bar is shifted to the right. The png file looks correct, and so does the first pdf file (produced with log=False).

import matplotlib.pyplot as plt
import numpy as np

data = np.random.normal(size=1000)

### correct pdf

fig = plt.figure()
ax = fig.add_subplot(111)

ax.hist(data, fill=False, log=False)

fig.savefig('plot1.pdf', format='pdf')
fig.savefig('plot1.png', format='png')

### wrong pdf

fig = plt.figure()
ax = fig.add_subplot(111)

ax.hist(data, fill=False, log=True)

fig.savefig('plot2.pdf', format='pdf')
fig.savefig('plot2.png', format='png')
@jkseppan jkseppan was assigned Mar 28, 2012

Happens with svg too.

@jkseppan jkseppan added a commit to jkseppan/matplotlib that referenced this issue Apr 6, 2012
@jkseppan jkseppan Fix issue #804 by altering path clipping 4cd75cd

Fix merged into v1.1.x.

@jkseppan jkseppan closed this Apr 13, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment