ImageFile.Stoner__plot__utils__auto_fit_fontsize

ImageFile.Stoner__plot__utils__auto_fit_fontsize(width, height, scale_down=True, scale_up=False)

Resale the font size of a matplotlib text object to fit within a box.

Parameters
  • text (matplotlib.text.Text) – Text object to be scaled in Figure units.

  • width,height (float) – Target width and height to scale to.

Keyword Arguments

scale_up (scale_down,) – Whether to reduce the font size to fit (default True), or increase it to fit (default False)

Returns

(float) – scaling factor applied.