stepb button(plt axes([ , , , ])"step"stepb on_clicked(self on_stepresetb button(plt axes([ , , , ])"reset"resetb on_clicked(self on_resetself qcheck checkbuttons(plt axes([ , , , ])["show -values","show policy"]self qcheck on_clicked(self show_valsself show_vals(noneplt show( def show_vals(self,event)self ax cla(array [[self [( , )for in range(self x_dim)for in range(self y_dim)self ax pcolormesh([ - for in range(self x_dim+ )][ - for in range(self y_dim+ )]arrayedgecolors='black',cmap='summer'for cmap see if self qcheck get_status()[ ]"show policyfor ( ,yin self qmaxv max(self [( , )][afor in self actionsfor in self actionsif self [( , )][ =maxvdraw arrow in appropriate direction self ax arrow( , ,self xoff[ ]* ,self yoff[ ]* color='red',width= head_width= length_includes_head=trueif self qcheck get_status()[ ]"show -valuesself show_q(eventelseself show_v(eventself ax set_xticks(range(self x_dim)self ax set_xticklabels(range(self x_dim)self ax set_yticks(range(self y_dim)self ax set_yticklabels(range(self y_dim)plt draw( def on_step(self,event)self vi( self show_vals(event def show_v(self,event)"""show values""for ( ,yin self vself ax text( , ,"{val }format(val=self [( , )]),ha='center' def show_q(self,event)"""show -values""for ( ,yin self qversion june