Skip to content

Commit

Permalink
Merge pull request #696 from mdboom/svg-duplicate-ids
Browse files Browse the repository at this point in the history
SVG output broken
  • Loading branch information
mdboom committed Feb 7, 2012
2 parents 97c58d2 + 0c8273f commit 9c676df
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/matplotlib/backends/backend_svg.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,14 +532,14 @@ def draw_markers(self, gc, marker_path, marker_trans, path, trans, rgbFace=None)
return

writer = self.writer
dictkey = (id(marker_path), marker_trans)
path_data = self._convert_path(
marker_path,
marker_trans + Affine2D().scale(1.0, -1.0),
simplify=False)
dictkey = (path_data)
oid = self._markers.get(dictkey)
if oid is None:
oid = self._make_id('m', dictkey)
path_data = self._convert_path(
marker_path,
marker_trans + Affine2D().scale(1.0, -1.0),
simplify=False)
writer.start('defs')
writer.element('path', id=oid, d=path_data)
writer.end('defs')
Expand Down Expand Up @@ -573,7 +573,7 @@ def draw_path_collection(self, gc, master_transform, paths, all_transforms,
transform = Affine2D(transform.get_matrix()).scale(1.0, -1.0)
d = self._convert_path(path, transform, simplify=False)
oid = 'C%x_%x_%s' % (self._path_collection_id, i,
self._make_id('', d))
self._make_id('', d))
writer.element('path', id=oid, d=d)
path_codes.append(oid)
writer.end('defs')
Expand Down

0 comments on commit 9c676df

Please sign in to comment.