File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -60,29 +60,36 @@ def __init__(self, data):
6060 delete = functools .partial (self .on_edit , method = "delete" )
6161 reject = functools .partial (self .on_edit , method = "reject" )
6262 insert = functools .partial (self .on_edit , method = "insert" )
63+
64+ # Check matplotlib version rectprops is deprecated with matplotlib 3.5.0 and then obsolete
65+ if matplotlib .__version__ >= '3.5.0' :
66+ property_name = 'props'
67+ else :
68+ property_name = 'rectprops'
69+
6370 self .span2 = SpanSelector (
6471 self .ax ,
6572 delete ,
6673 "horizontal" ,
6774 button = 1 ,
6875 useblit = True ,
69- rectprops = dict (facecolor = " red" , alpha = 0.3 ),
76+ ** { property_name : dict (facecolor = ' red' , alpha = 0.3 )} ,
7077 )
7178 self .span1 = SpanSelector (
7279 self .ax ,
7380 reject ,
7481 "horizontal" ,
7582 button = 2 ,
7683 useblit = True ,
77- rectprops = dict (facecolor = " blue" , alpha = 0.3 ),
84+ ** { property_name : dict (facecolor = ' blue' , alpha = 0.3 )} ,
7885 )
7986 self .span3 = SpanSelector (
8087 self .ax ,
8188 insert ,
8289 "horizontal" ,
8390 button = 3 ,
8491 useblit = True ,
85- rectprops = dict (facecolor = " green" , alpha = 0.3 ),
92+ ** { property_name : dict (facecolor = ' green' , alpha = 0.3 )} ,
8693 )
8794
8895 self .plot_signals (False )
You can’t perform that action at this time.
0 commit comments