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

Skip to content

Commit 960c33c

Browse files
committed
added an isinit check in LinearSegmentedColormap.is_gray
svn path=/trunk/matplotlib/; revision=5280
1 parent adaab54 commit 960c33c

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

lib/matplotlib/colors.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,7 @@ def _init():
501501
raise NotImplementedError("Abstract class only")
502502

503503
def is_gray(self):
504+
if not self._isinit: self._init()
504505
return (np.alltrue(self._lut[:,0] == self._lut[:,1])
505506
and np.alltrue(self._lut[:,0] == self._lut[:,2]))
506507

0 commit comments

Comments
 (0)