Skip to content

Commit

Permalink
Always remake the subsliced line. Fix matplotlib#5270
Browse files Browse the repository at this point in the history
Before, the subsliced line will only be made if it's sufficiently
smaller than before.  However, when zooming out after zooming in,
it may actually be *larger* than before.  Rather than tracking which is
occurring, it's best to just always remake -- it doesn't seem to be an
important optimization anyway.
  • Loading branch information
mdboom committed Oct 19, 2015
1 parent d028f87 commit 12ae18f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/matplotlib/lines.py
Expand Up @@ -717,10 +717,8 @@ def draw(self, renderer):
i0, = self._x_filled.searchsorted([x0], 'left')
i1, = self._x_filled.searchsorted([x1], 'right')
subslice = slice(max(i0 - 1, 0), i1 + 1)
# Don't remake the Path unless it will be sufficiently smaller.
if subslice.start > 100 or len(self._x) - subslice.stop > 100:
self.ind_offset = subslice.start
self._transform_path(subslice)
self.ind_offset = subslice.start
self._transform_path(subslice)

transf_path = self._get_transformed_path()

Expand Down

0 comments on commit 12ae18f

Please sign in to comment.