Skip to content
This repository has been archived by the owner on Jun 16, 2018. It is now read-only.

Commit

Permalink
Optimization is dangerous because if transforms changed the transform…
Browse files Browse the repository at this point in the history
…ation should not be skipped. Instead, avoid recomputing axes patch every time a grid line is added.
  • Loading branch information
astrofrog committed Aug 5, 2014
1 parent ce2f14a commit 946dc06
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
3 changes: 2 additions & 1 deletion wcsaxes/coordinate_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,10 @@ def _draw(self, renderer, bboxes, ticklabels_bbox):

if self._grid_type == 'lines':

frame_patch = self.frame.patch
for path in self.grid_lines:
p = PathPatch(path, **self.grid_lines_kwargs)
p.set_clip_path(self.frame.patch)
p.set_clip_path(frame_patch)
p.draw(renderer)

else:
Expand Down
6 changes: 0 additions & 6 deletions wcsaxes/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ def data(self, value):
self._pixel = None
self._world = None
else:
if np.all(value == self._data):
return # no need to reset and recompute
self._data = value
self._pixel = self.parent_axes.transData.transform(self._data)
self._world = self.transform.transform(self._data)
Expand All @@ -46,8 +44,6 @@ def pixel(self, value):
self._pixel = None
self._world = None
else:
if np.all(value == self._pixel):
return # no need to reset and recompute
self._data = self.parent_axes.transData.inverted().transform(self._data)
self._pixel = value
self._world = self.transform.transform(self._data)
Expand All @@ -64,8 +60,6 @@ def world(self, value):
self._pixel = None
self._world = None
else:
if np.all(value == self._world):
return # no need to reset and recompute
self._data = self.transform.transform(value)
self._pixel = self.parent_axes.transData.transform(self._data)
self._world = value
Expand Down

0 comments on commit 946dc06

Please sign in to comment.