Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
BUG : don't use mutable objects as dictionary keys
Base key on the id of the transform.  This maintains
the old behavior and does not break the python hashable
object model.

changed the variable id -> pid so as to not shadow the
method `id`

Closes #2828
  • Loading branch information
tacaswell committed Jun 9, 2014
commit 9b9c0c6fbdd53ec42e2a1edecc9c6895b6f7a3ef
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
2014-06-07 Fixed bug so radial plots can be saved as ps in py3k.

2014-06-01 Changed the fmt kwarg of errorbar to support the
the mpl convention that "none" means "don't draw it",
and to default to the empty string, so that plotting
Expand Down
11 changes: 6 additions & 5 deletions lib/matplotlib/backends/backend_ps.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,15 +554,16 @@ def _convert_path(self, path, transform, clip=False, simplify=None):
return ps

def _get_clip_path(self, clippath, clippath_transform):
id = self._clip_paths.get((clippath, clippath_transform))
if id is None:
id = 'c%x' % len(self._clip_paths)
ps_cmd = ['/%s {' % id]
key = (clippath, id(clippath_transform))
pid = self._clip_paths.get(key)
if pid is None:
pid = 'c%x' % len(self._clip_paths)
ps_cmd = ['/%s {' % pid]
ps_cmd.append(self._convert_path(clippath, clippath_transform,
simplify=False))
ps_cmd.extend(['clip', 'newpath', '} bind def\n'])
self._pswriter.write('\n'.join(ps_cmd))
self._clip_paths[(clippath, clippath_transform)] = id
self._clip_paths[key] = pid
return id

def draw_path(self, gc, path, transform, rgbFace=None):
Expand Down