Skip to content

Commit a23e704

Browse files
committed
Fix mpl3.3 deprecation warning from 'extend' passed to colorbar()
1 parent a298f81 commit a23e704

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

proplot/axes/plot.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
_flexible_getattr,
3636
_not_none,
3737
_state_context,
38+
_version,
39+
_version_mpl,
3840
docstring,
3941
warnings,
4042
)
@@ -4028,7 +4030,8 @@ def colorbar_wrapper(
40284030
'ticklocation': ticklocation,
40294031
'extendfrac': extendsize
40304032
})
4031-
mappable.extend = extend # matplotlib >=3.3
4033+
if _version_mpl >= _version('3.3'):
4034+
mappable.extend = kwargs.pop('extend') # matplotlib >=3.3
40324035
cb = self.figure.colorbar(mappable, **kwargs)
40334036
axis = self.xaxis if orientation == 'horizontal' else self.yaxis
40344037

0 commit comments

Comments
 (0)