def _scale_mpl_figure(fig, scale):
 fig.set_size_inches((fig.get_size_inches() * scale))
 fig.set_dpi((fig.get_dpi() * scale))
 import matplotlib as mpl
 if (scale >= 1):
  sfactor = (scale ** 2)
 elif (scale < 1):
  sfactor = (- ((1.0 / scale) ** 2))
 for text in fig.findobj(mpl.text.Text):
  fs = text.get_fontsize()
  new_size = (fs + sfactor)
  if (new_size <= 0):
   raise ValueError('could not rescale matplotlib fonts, consider increasing "scale"')
  text.set_fontsize(new_size)
 fig.canvas.draw()

def _scale_mpl_figure ( fig , scale ) : fig . set_size_inches ( ( fig . get_size_inches ( ) * scale ) ) fig . set_dpi ( ( fig . get_dpi ( ) * scale ) ) import matplotlib as mpl if ( scale >= 1 ) : sfactor = ( scale ** 2 ) elif ( scale < 1 ) : sfactor = ( - ( ( 1.0 / scale ) ** 2 ) ) for text in fig . findobj ( mpl . text . Text ) : fs = text . get_fontsize ( ) new_size = ( fs + sfactor ) if ( new_size <= 0 ) : raise ValueError ( 'could not rescale matplotlib fonts, consider increasing "scale"' ) text . set_fontsize ( new_size ) fig . canvas . draw ( )
magic scaling helper .