holoviews.plotting.mpl.renderer module#

class holoviews.plotting.mpl.renderer.MPLRenderer(*, interactive, backend, center, css, dpi, fig, fps, holomap, mode, post_render_hooks, size, widget_location, widget_mode, info_fn, key_fn, name)[source]#

Bases: Renderer

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.

Parameter Definitions


Parameters inherited from:

holoviews.plotting.renderer.Renderer: key_fn, info_fn, center, fps, size, widget_location, widget_mode, css, post_render_hooks

backend = String(default='matplotlib', label='Backend')

The backend name.

dpi = Integer(default=72, inclusive_bounds=(True, True), label='Dpi')

The render resolution in dpi (dots per inch)

fig = Selector(default='auto', label='Fig', names={}, objects=['png', 'svg', 'pdf', 'pgf', 'html', None, 'auto'])

Output render format for static figures. If None, no figure rendering will occur.

holomap = Selector(default='auto', label='Holomap', names={}, objects=['widgets', 'scrubber', 'webm', 'mp4', 'gif', None, 'auto'])

Output render multi-frame (typically animated) format. If None, no multi-frame rendering will occur.

mode = Selector(default='default', label='Mode', names={}, objects=['default'])

Whether to render the object in regular or server mode. In server mode a bokeh Document will be returned which can be served as a bokeh server app. By default renders all output is rendered to HTML.

interactive = Boolean(default=False, label='Interactive')

Whether to enable interactive plotting allowing interactive plotting with explicitly calling show.

get_size(plot)[source]#

Return the display size associated with a plot before rendering to any particular format. Used to generate appropriate HTML display.

Returns a tuple of (width, height) in pixels.

classmethod load_nb(inline=True)[source]#

Initialize matplotlib backend

classmethod plot_options(obj, percent_size)[source]#

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.

show(obj)[source]#

Renders the supplied object and displays it using the active GUI backend.

classmethod state()[source]#

Context manager to handle global state for a backend, allowing Plot classes to temporarily override that state.

class holoviews.plotting.mpl.renderer.OutputWarning(*, name)[source]#

Bases: Parameterized

Parameter Definitions