python - Matplotlib: savefig produces incorrect SVG image for bar chart with log-scaled Y-axis -


i'm having issue when trying save bar plot svg. specifically, when save bar plot pdf savefig, correct result. however, when save svg, bars not terminate @ x-axis should descend past bottom of figure. problem occurs when use log scale bar plot. otherwise, hunky dory.

here code saving plot both svg , pdf:

import matplotlib.pyplot plt import numpy np  n = 10 ind = np.arange(n) series1 = xrange(n) series2 = [ n - s1_i s1_i in series1 ] fig, ax = plt.subplots() width = 0.2 rects = [ ax.bar(ind, series1, width, color='r', log=true),    ax.bar(ind + width, series2, width, color='b', log=true) ]  plt.savefig("test.pdf") plt.savefig("test.svg") 

here 2 sample images: the pdf version

you can see there no glaring issues pdf version.

the svg version

the svg version has bars not clipped, wrong.

update: in response tcaswell

i'm using ubuntu 14.04 (kernel version 3.16.0) python 2.7.6, matplotlib version 1.3.1, numpy version 1.8.2.

i've tried viewing svg both display , rsvg-view-3, , both show same result; if convert pdf using imagemagick's convert command line tool , open evince or viewer such acroread, image remains flawed (not particularly surprising).

this known bug in librsvg (and limitation in libqtsvg handles restricted sub-set of svg (1.2 tiny) not include clipping @ all).

the svg render correctly in modern browser.

there longer discussion @ https://github.com/matplotlib/matplotlib/issues/4341, long , short of renderer buggy.


Popular posts from this blog

debugging - Reference - What does this error mean in PHP? -

How to parse output from sse.client in Python? -