class_docstr: Exporter used to render data from matplotlib, either to a stream
  or directly to file.
  
  The __call__ method renders an HoloViews component to raw data of
  a specified matplotlib format.  The save method is the
  corresponding method for saving a HoloViews objects to disk.
  
  The save_fig and save_anim methods are used to save matplotlib
  figure and animation objects. These match the two primary return
  types of plotting class implemented with matplotlib.
class_docstr_tok: ["Exporter","used","to","render","data","from","matplotlib",",","either","to","a","stream","or","directly","to","file",".","The","__call__","method","renders","an","HoloViews","component","to","raw","data","of","a","specified","matplotlib","format",".","The","save","method","is","the","corresponding","method","for","saving","a","HoloViews","objects","to","disk",".","The","save_fig","and","save_anim","methods","are","used","to","save","matplotlib","figure","and","animation","objects",".","These","match","the","two","primary","return","types","of","plotting","class","implemented","with","matplotlib","."]
docstr: Given a holoviews object and a percentage size, apply heuristics
  to compute a suitable figure size. For instance, scaling layouts
  and grids linearly can result in unwieldy figure sizes when there
  are a large number of elements. As ad hoc heuristics are used,
  this functionality is kept separate from the plotting classes
  themselves.
  
  Used by the IPython Notebook display hooks and the save
  utility. Note that this can be overridden explicitly per object
  using the fig_size and size plot options.
docstr_tok: ["Given","a","holoviews","object","and","a","percentage","size",",","apply","heuristics","to","compute","a","suitable","figure","size",".","For","instance",",","scaling","layouts","and","grids","linearly","can","result","in","unwieldy","figure","sizes","when","there","are","a","large","number","of","elements",".","As","ad","hoc","heuristics","are","used",",","this","functionality","is","kept","separate","from","the","plotting","classes","themselves",".","Used","by","the","IPython","Notebook","display","hooks","and","the","save","utility",".","Note","that","this","can","be","overridden","explicitly","per","object","using","the","fig_size","and","size","plot","options","."]
code: def plot_options(cls, obj, percent_size):
      """
      Given a holoviews object and a percentage size, apply heuristics
      to compute a suitable figure size. For instance, scaling layouts
      and grids linearly can result in unwieldy figure sizes when there
      are a large number of elements. As ad hoc heuristics are used,
      this functionality is kept separate from the plotting classes
      themselves.
  
      Used by the IPython Notebook display hooks and the save
      utility. Note that this can be overridden explicitly per object
      using the fig_size and size plot options.
      """
      from .plot import MPLPlot
  
      factor = percent_size / 100.0
      obj = obj.last if isinstance(obj, HoloMap) else obj
      options = Store.lookup_options(cls.backend, obj, "plot").options
      fig_size = options.get("fig_size", MPLPlot.fig_size) * factor
  
      return dict(
          {"fig_size": fig_size},
          **MPLPlot.lookup_options(obj, "plot").options,
      )
  
imports: import base64
  import os
  from contextlib import contextmanager
  from io import BytesIO
  from itertools import chain
  from tempfile import NamedTemporaryFile
  import matplotlib
  import param
  from matplotlib import pyplot
  from param.parameterized import bothmethod
  from ...core import HoloMap
  from ...core.options import Store
  from ..renderer import HTML_TAGS, MIME_TYPES, Renderer
  from .util import get_old_rcparams, get_tight_bbox
label_desc: Use image node_id 2 for calling the MPLRenderer obj's underlying member method code with example usage: obj.plot_options(cls, obj, percent_size) and returns: dict