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

Skip to content

Commit 3a670b3

Browse files
committed
fix sf bug 2806283 (patch by Joonas Paalasmaa)
svn path=/branches/v0_98_5_maint/; revision=7227
1 parent d013280 commit 3a670b3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/matplotlib/colorbar.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import matplotlib.patches as patches
3030
import matplotlib.collections as collections
3131
import matplotlib.contour as contour
32+
import matplotlib.artist as martist
3233

3334
make_axes_kw_doc = '''
3435
@@ -625,9 +626,10 @@ def __init__(self, ax, mappable, **kw):
625626
self.mappable = mappable
626627
kw['cmap'] = mappable.cmap
627628
kw['norm'] = mappable.norm
628-
kw['alpha'] = mappable.get_alpha()
629+
629630
if isinstance(mappable, contour.ContourSet):
630631
CS = mappable
632+
kw['alpha'] = mappable.get_alpha()
631633
kw['boundaries'] = CS._levels
632634
kw['values'] = CS.cvalues
633635
kw['extend'] = CS.extend
@@ -638,6 +640,9 @@ def __init__(self, ax, mappable, **kw):
638640
if not CS.filled:
639641
self.add_lines(CS)
640642
else:
643+
if isinstance(mappable, martist.Artist):
644+
kw['alpha'] = mappable.get_alpha()
645+
641646
ColorbarBase.__init__(self, ax, **kw)
642647

643648

0 commit comments

Comments
 (0)