mirplot

xicsrt.util.mirplot

An interface to matplotlib that allows specification of complex plots though a list of parameter dictionaries.

Example

The simplest example:

import numpy as np
import mirplot

x = np.arange(10)
y = x
plotlist = [{'x':x, 'y':y}]
fig = mirplot.plot_to_screen(plotlist)

Any supported plot properties can be added to the plot dictionary:

To add multiple plots to a single figure add parameter dicts ta the plotlist:

If axes names are provided then plots will be added to separate subfigures (stacked vertically). Each unique axes name will result in a new subfigure.

mirplot can also be used with predifined axes. For this purpose the axes must be placed into a dictionary and passed to plot_to_axes.

mirplot properties

A set of unique plot and axes properties are defined by mirplot to enable a complete dictionary definition.

typestr (‘line’)

Allowed Values: line, errorbar, scatter, fill_between, hline, vline, hspan, vspan.

legendbool (false)

Set to true to show the legend in this subplot.

matplotlib properties

Any matplotlib plot or axes property that can be set using a simple set_prop(value) method is supported. Certain properties requiring a more complex set call are also supported.

plot_to_screen(plotlist, show=True)[source]
plot_to_file(plotlist, filename)[source]
plot_to_axes(plotlist, axesdict)[source]

Private Members

_apply_axes_prop(prop, axes)[source]
_apply_fig_prop(prop, ax)[source]
_apply_plot_prop(prop, axes)[source]
_autoname_plots(plotlist, sequential=False)[source]

Automatically name any plots that were not given a name by the user.

_clean_plot_prop(prop)[source]

Check the plot properties and cleanup or provides errors.

_get_figure_size(numaxes)[source]

Return the default figure size. Width: 8 units Height: 3 units for every subplot or max 9 units :returns: The figure size in inches. :rtype: (width, height)

_make_axes(namelist, fig)[source]
_make_figure(namelist)[source]
_set_plot_defaults(prop)[source]