matplotlib/matplotlib — Issue #696: SVG output broken
Author: ruidc
Created: 2012-02-07 12:48:20+00:00
State: open

SVG output is broken, as validated through http://validator.w3.org/#validate_by_upload
e.g. run the following and upload the output, and the id's on elements are used multiple times:

```python
from matplotlib.figure import Figure
from matplotlib.backends.backend_svg import FigureCanvasSVG

def get_series():
yield [2.5, 1.5, 0.5], [1.1, 2.1, 3.1], dict(color='b', hatch='|')
yield [2.6, 1.6, 0.6], [1.2, 2.2, 3.2], dict(color='r', hatch='|')

def do_chart(file):
fig = Figure(facecolor='#FFFFFF')
canvas = FigureCanvasSVG(fig)
ax = fig.add_subplot(1, 1, 1)
for xs, ys, attributes in get_series():
ax.barh(xs, ys, 0.1, **attributes)
canvas.print_figure(from_file)

if __name__ == '__main__':
from_file = r"C:\temp\prob.svg"
do_chart(from_file)
```