#NEWLINE# def on_resize( self , event ) : #NEWLINE# #INDENT# fig_width = self . ax . figure . get_figwidth ( ) #NEWLINE# fig_height = self . ax . figure . get_figheight ( ) #NEWLINE# x0 = ( self . margins [ 0 ] / y1 ) #NEWLINE# x1 = ( 1 - ( self . margins [ 1 ] / fig_width ) ) #NEWLINE# y0 = ( self . margins [ 2 ] / fig_height ) #NEWLINE# y1 = ( 1 - ( self . margins [ 3 ] / fig_height ) ) #NEWLINE# dx = max ( 0.01 , ( x1 - x0 ) ) #NEWLINE# dy = max ( 0.01 , ( y1 - y0 ) ) #NEWLINE# self . ax . set_position ( [ x0 , y0 , dx , dy ] ) #NEWLINE# self . ax . figure . canvas . draw ( )