Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c817ae0

Browse files
committed
Support Line2D objects without associated Axes objects.
svn path=/branches/v0_99_maint/; revision=7567
1 parent 6be06d2 commit c817ae0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/matplotlib/lines.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ def recache(self):
459459
self._y = self._xy[:, 1] # just a view
460460

461461
self._subslice = False
462-
if len(x) > 100 and self._is_sorted(x):
462+
if self.axes and len(x) > 100 and self._is_sorted(x):
463463
self._subslice = True
464464
if hasattr(self, '_path'):
465465
interpolation_steps = self._path._interpolation_steps
@@ -496,7 +496,7 @@ def _is_sorted(self, x):
496496
def draw(self, renderer):
497497
if self._invalid:
498498
self.recache()
499-
if self._subslice:
499+
if self._subslice and self.axes:
500500
# Need to handle monotonically decreasing case also...
501501
x0, x1 = self.axes.get_xbound()
502502
i0, = self._x.searchsorted([x0], 'left')

0 commit comments

Comments
 (0)