File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313import numpy as np
1414import matplotlib .pyplot as plt
1515from numpy .random import randn , randint
16+ from matplotlib .font_manager import FontProperties
1617
1718instructions = """
1819Player A: Player B:
@@ -216,12 +217,11 @@ def draw(self, evt):
216217 " " + str (self .pads [0 ].score ))
217218 self .pads [1 ].disp .set_label (
218219 " " + str (self .pads [1 ].score ))
219- self .ax .legend (loc = 'center' )
220- self .leg = self .ax .get_legend ()
221- self .leg .get_frame ().set_alpha (.2 )
222- plt .setp (self .leg .get_texts (), fontweight = 'bold' ,
223- fontsize = 'xx-large' )
224- self .leg .get_frame ().set_facecolor ('0.2' )
220+ self .ax .legend (loc = 'center' , framealpha = .2 ,
221+ facecolor = '0.5' ,
222+ prop = FontProperties (size = 'xx-large' ,
223+ weight = 'bold' ))
224+
225225 self .background = None
226226 self .ax .figure .canvas .draw_idle ()
227227 return True
You can’t perform that action at this time.
0 commit comments