code: def set_matplotlib_fontsize(matplotlib: ModuleType,
                              fontsize: Union[int, float] = 12) -> None:
      
      font = {
          # http://stackoverflow.com/questions/3899980
          # http://matplotlib.org/users/customizing.html
          'family': 'sans-serif',
          # ... serif, sans-serif, cursive, fantasy, monospace
          'style': 'normal',  # normal (roman), italic, oblique
          'variant': 'normal',  # normal, small-caps
          'weight': 'normal',
          # ... normal [=400], bold [=700], bolder [relative to current],
          # lighter [relative], 100, 200, 300, ..., 900
          'size': fontsize  # in pt (default 12)
      }
      # noinspection PyUnresolvedReferences
      matplotlib.rc('font', **font)
      legend = {
          # http://stackoverflow.com/questions/7125009
          'fontsize': fontsize
      }
      # noinspection PyUnresolvedReferences
      matplotlib.rc('legend', **legend)
docs: Sets the current font size within the ``matplotlib`` library.
  
      **WARNING:** not an appropriate method for multithreaded environments, as
      it writes (indirectly) to ``matplotlib`` global objects. See CamCOPS for
      alternative methods.