Skip to content

fix for bug #996 and related issues #1011

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 15, 2012
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
44 changes: 18 additions & 26 deletions lib/matplotlib/backends/backend_macosx.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,42 +63,34 @@ def draw_path_collection(self, gc, master_transform, paths, all_transforms,
offsets, offsetTrans, facecolors, edgecolors,
linewidths, linestyles, antialiaseds, urls,
offset_position):
cliprect = gc.get_clip_rectangle()
clippath, clippath_transform = gc.get_clip_path()
if all_transforms:
transforms = [numpy.dot(master_transform, t) for t in all_transforms]
if offset_position=='data':
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know its been merged already, but its worth mentioning that the lines:

if offset_position=='data':
    offset_position = True
else:
   offset_position = False

are exactly equivalent to:

offset_position = (offset_position=='data')

(un-necessary parentheses added for readability)

offset_position = True
else:
transforms = [master_transform]
gc.draw_path_collection(cliprect,
clippath,
clippath_transform,
paths,
transforms,
offsets,
offsetTrans,
facecolors,
edgecolors,
linewidths,
linestyles,
antialiaseds)
offset_position = False
path_ids = []
for path, transform in self._iter_collection_raw_paths(
master_transform, paths, all_transforms):
path_ids.append((path, transform))
master_transform = master_transform.get_matrix()
all_transforms = [t.get_matrix() for t in all_transforms]
offsetTrans = offsetTrans.get_matrix()
gc.draw_path_collection(master_transform, path_ids, all_transforms,
offsets, offsetTrans, facecolors, edgecolors,
linewidths, linestyles, antialiaseds,
offset_position)

def draw_quad_mesh(self, gc, master_transform, meshWidth, meshHeight,
coordinates, offsets, offsetTrans, facecolors,
antialiased, showedges):
cliprect = gc.get_clip_rectangle()
clippath, clippath_transform = gc.get_clip_path()
gc.draw_quad_mesh(master_transform,
cliprect,
clippath,
clippath_transform,
antialiased, edgecolors):
gc.draw_quad_mesh(master_transform.get_matrix(),
meshWidth,
meshHeight,
coordinates,
offsets,
offsetTrans,
offsetTrans.get_matrix(),
facecolors,
antialiased,
showedges)
edgecolors)

def new_gc(self):
self.gc.save()
Expand Down
Loading