matplotlib

This Page

The top level matplotlib module

matplotlib.use(arg, warn=True, force=False)

Set the matplotlib backend to one of the known backends.

The argument is case-insensitive. warn specifies whether a warning should be issued if a backend has already been set up. force is an experimental flag that tells matplotlib to attempt to initialize a new backend by reloading the backend module.

Note

This function must be called before importing pyplot for the first time; or, if you are not using pyplot, it must be called before importing matplotlib.backends. If warn is True, a warning is issued if you try and call this after pylab or pyplot have been loaded. In certain black magic use cases, e.g. pyplot.switch_backend(), we are doing the reloading necessary to make the backend switch work (in some cases, e.g., pure image backends) so one can set warn=False to suppress the warnings.

To find out which backend is currently set, see matplotlib.get_backend().

matplotlib.get_backend()

Return the name of the current backend.

matplotlib.rcParams

An instance of RcParams for handling default matplotlib values.

matplotlib.rc_context(*args, **kwds)

Return a context manager for managing rc settings.

This allows one to do:

with mpl.rc_context(fname='screen.rc'):
    plt.plot(x, a)
    with mpl.rc_context(fname='print.rc'):
        plt.plot(x, b)
    plt.plot(x, c)

The ‘a’ vs ‘x’ and ‘c’ vs ‘x’ plots would have settings from ‘screen.rc’, while the ‘b’ vs ‘x’ plot would have settings from ‘print.rc’.

A dictionary can also be passed to the context manager:

with mpl.rc_context(rc={'text.usetex': True}, fname='screen.rc'):
    plt.plot(x, a)

The ‘rc’ dictionary takes precedence over the settings loaded from ‘fname’. Passing a dictionary only is also valid. For example a common usage is:

with mpl.rc_context(rc={'interactive': False}):
    fig, ax = plt.subplots()
    ax.plot(range(3), range(3))
    fig.savefig('A.png', format='png')
    plt.close(fig)
matplotlib.rc(group, **kwargs)

Set the current rc params. Group is the grouping for the rc, e.g., for lines.linewidth the group is lines, for axes.facecolor, the group is axes, and so on. Group may also be a list or tuple of group names, e.g., (xtick, ytick). kwargs is a dictionary attribute name/value pairs, e.g.,:

rc('lines', linewidth=2, color='r')

sets the current rc params and is equivalent to:

rcParams['lines.linewidth'] = 2
rcParams['lines.color'] = 'r'

The following aliases are available to save typing for interactive users:

Alias Property
‘lw’ ‘linewidth’
‘ls’ ‘linestyle’
‘c’ ‘color’
‘fc’ ‘facecolor’
‘ec’ ‘edgecolor’
‘mew’ ‘markeredgewidth’
‘aa’ ‘antialiased’

Thus you could abbreviate the above rc command as:

rc('lines', lw=2, c='r')

Note you can use python’s kwargs dictionary facility to store dictionaries of default parameters. e.g., you can customize the font rc as follows:

font = {'family' : 'monospace',
        'weight' : 'bold',
        'size'   : 'larger'}

rc('font', **font)  # pass in the font dict as kwargs

This enables you to easily switch between several configurations. Use matplotlib.style.use('default') or rcdefaults() to restore the default rc params after changes.

matplotlib.rc_file(fname)

Update rc params from file.

matplotlib.rcdefaults()

Restore the rc params from Matplotlib’s internal defaults.

See also

rc_file_defaults
Restore the rc params from the rc file originally loaded by Matplotlib.
matplotlib.style.use
Use a specific style file. Call style.use('default') to restore the default style.
matplotlib.rc_file_defaults()

Restore the rc params from the original rc file loaded by Matplotlib.

class matplotlib.RcParams(*args, **kwargs)

A dictionary object including validation

validating functions are defined and associated with rc parameters in matplotlib.rcsetup

find_all(pattern)

Return the subset of this RcParams dictionary whose keys match, using re.search(), the given pattern.

Note

Changes to the returned dictionary are not propagated to the parent RcParams dictionary.

msg_depr = u'%s is deprecated and replaced with %s; please use the latter.'
msg_depr_ignore = u'%s is deprecated and ignored. Use %s'
msg_depr_set = u'%s is deprecated. Please remove it from your matplotlibrc and/or style files.'
msg_obsolete = u'%s is obsolete. Please remove it from your matplotlibrc and/or style files.'
validate = {u'_internal.classic_mode': <function validate_bool at 0x7f24d7d2f320>, u'agg.path.chunksize': <function validate_int at 0x7f24d7d2f758>, u'animation.avconv_args': <function unicodelist at 0x7f24d7d2fe60>, u'animation.avconv_path': <function validate_animation_writer_path at 0x7f24d7d33cf8>, u'animation.bitrate': <function validate_int at 0x7f24d7d2f758>, u'animation.codec': <type 'unicode'>, u'animation.convert_args': <function unicodelist at 0x7f24d7d2fe60>, u'animation.convert_path': <function validate_animation_writer_path at 0x7f24d7d33cf8>, u'animation.embed_limit': <function validate_float at 0x7f24d7d2f488>, u'animation.ffmpeg_args': <function unicodelist at 0x7f24d7d2fe60>, u'animation.ffmpeg_path': <function validate_animation_writer_path at 0x7f24d7d33cf8>, u'animation.frame_format': <matplotlib.rcsetup.ValidateInStrings object at 0x7f24d7d35150>, u'animation.html': <matplotlib.rcsetup.ValidateInStrings object at 0x7f24d7d351d0>, u'animation.html_args': <function unicodelist at 0x7f24d7d2fe60>, u'animation.mencoder_args': <function unicodelist at 0x7f24d7d2fe60>, u'animation.mencoder_path': <function validate_animation_writer_path at 0x7f24d7d33cf8>, u'animation.writer': <matplotlib.rcsetup.ValidateInStrings object at 0x7f24d7d35110>, u'axes.autolimit_mode': <matplotlib.rcsetup.ValidateInStrings object at 0x7f24d7d35490>, u'axes.axisbelow': <function validate_axisbelow at 0x7f24d7d2f668>, u'axes.edgecolor': <function validate_color at 0x7f24d7d2fcf8>, u'axes.facecolor': <function validate_color at 0x7f24d7d2fcf8>, u'axes.formatter.limits': <matplotlib.rcsetup.validate_nseq_int object at 0x7f24d7d35410>, u'axes.formatter.min_exponent': <function validate_int at 0x7f24d7d2f758>, u'axes.formatter.offset_threshold': <function validate_int at 0x7f24d7d2f758>, u'axes.formatter.use_locale': <function validate_bool at 0x7f24d7d2f320>, u'axes.formatter.use_mathtext': <function validate_bool at 0x7f24d7d2f320>, u'axes.formatter.useoffset': <function validate_bool at 0x7f24d7d2f320>, u'axes.grid': <function validate_bool at 0x7f24d7d2f320>, u'axes.grid.axis': <matplotlib.rcsetup.ValidateInStrings object at 0x7f24d7d35210>, u'axes.grid.which': <matplotlib.rcsetup.ValidateInStrings object at 0x7f24d7d35190>, u'axes.hold': <function deprecate_axes_hold at 0x7f24d7d2f410>, u'axes.labelcolor': <function validate_color at 0x7f24d7d2fcf8>, u'axes.labelpad': <function validate_float at 0x7f24d7d2f488>, u'axes.labelsize': <function validate_fontsize at 0x7f24d7d2ff50>, u'axes.labelweight': <type 'unicode'>, u'axes.linewidth': <function validate_float at 0x7f24d7d2f488>, u'axes.prop_cycle': <function validate_cycler at 0x7f24d7d33c08>, u'axes.spines.bottom': <function validate_bool at 0x7f24d7d2f320>, u'axes.spines.left': <function validate_bool at 0x7f24d7d2f320>, u'axes.spines.right': <function validate_bool at 0x7f24d7d2f320>, u'axes.spines.top': <function validate_bool at 0x7f24d7d2f320>, u'axes.titlepad': <function validate_float at 0x7f24d7d2f488>, u'axes.titlesize': <function validate_fontsize at 0x7f24d7d2ff50>, u'axes.titleweight': <type 'unicode'>, u'axes.unicode_minus': <function validate_bool at 0x7f24d7d2f320>, u'axes.xmargin': <matplotlib.rcsetup.ValidateInterval object at 0x7f24d7d354d0>, u'axes.ymargin': <matplotlib.rcsetup.ValidateInterval object at 0x7f24d7d35510>, u'axes3d.grid': <function validate_bool at 0x7f24d7d2f320>, u'backend': <function validate_backend at 0x7f24d7d2f8c0>, u'backend.qt4': <matplotlib.rcsetup.ValidateInStrings object at 0x7f24d7d30ad0>, u'backend.qt5': <matplotlib.rcsetup.ValidateInStrings object at 0x7f24d7d30b10>, u'backend_fallback': <function validate_bool at 0x7f24d7d2f320>, u'boxplot.bootstrap': <function validate_int_or_None at 0x7f24d7d2f7d0>, u'boxplot.boxprops.color': <function validate_color at 0x7f24d7d2fcf8>, u'boxplot.boxprops.linestyle': <function _validate_linestyle at 0x7f24d7d33d70>, u'boxplot.boxprops.linewidth': <function validate_float at 0x7f24d7d2f488>, u'boxplot.capprops.color': <function validate_color at 0x7f24d7d2fcf8>, u'boxplot.capprops.linestyle': <function _validate_linestyle at 0x7f24d7d33d70>, u'boxplot.capprops.linewidth': <function validate_float at 0x7f24d7d2f488>, u'boxplot.flierprops.color': <function validate_color at 0x7f24d7d2fcf8>, u'boxplot.flierprops.linestyle': <function _validate_linestyle at 0x7f24d7d33d70>, u'boxplot.flierprops.linewidth': <function validate_float at 0x7f24d7d2f488>, u'boxplot.flierprops.marker': <type 'unicode'>, u'boxplot.flierprops.markeredgecolor': <function validate_color at 0x7f24d7d2fcf8>, u'boxplot.flierprops.markerfacecolor': <function validate_color_or_auto at 0x7f24d7d2fc08>, u'boxplot.flierprops.markersize': <function validate_float at 0x7f24d7d2f488>, u'boxplot.meanline': <function validate_bool at 0x7f24d7d2f320>, u'boxplot.meanprops.color': <function validate_color at 0x7f24d7d2fcf8>, u'boxplot.meanprops.linestyle': <function _validate_linestyle at 0x7f24d7d33d70>, u'boxplot.meanprops.linewidth': <function validate_float at 0x7f24d7d2f488>, u'boxplot.meanprops.marker': <type 'unicode'>, u'boxplot.meanprops.markeredgecolor': <function validate_color at 0x7f24d7d2fcf8>, u'boxplot.meanprops.markerfacecolor': <function validate_color at 0x7f24d7d2fcf8>, u'boxplot.meanprops.markersize': <function validate_float at 0x7f24d7d2f488>, u'boxplot.medianprops.color': <function validate_color at 0x7f24d7d2fcf8>, u'boxplot.medianprops.linestyle': <function _validate_linestyle at 0x7f24d7d33d70>, u'boxplot.medianprops.linewidth': <function validate_float at 0x7f24d7d2f488>, u'boxplot.notch': <function validate_bool at 0x7f24d7d2f320>, u'boxplot.patchartist': <function validate_bool at 0x7f24d7d2f320>, u'boxplot.showbox': <function validate_bool at 0x7f24d7d2f320>, u'boxplot.showcaps': <function validate_bool at 0x7f24d7d2f320>, u'boxplot.showfliers': <function validate_bool at 0x7f24d7d2f320>, u'boxplot.showmeans': <function validate_bool at 0x7f24d7d2f320>, u'boxplot.vertical': <function validate_bool at 0x7f24d7d2f320>, u'boxplot.whiskerprops.color': <function validate_color at 0x7f24d7d2fcf8>, u'boxplot.whiskerprops.linestyle': <function _validate_linestyle at 0x7f24d7d33d70>, u'boxplot.whiskerprops.linewidth': <function validate_float at 0x7f24d7d2f488>, u'boxplot.whiskers': <function validate_whiskers at 0x7f24d7d33140>, u'contour.corner_mask': <function validate_corner_mask at 0x7f24d7d33410>, u'contour.negative_linestyle': <function _validate_linestyle at 0x7f24d7d33d70>, u'datapath': <function validate_path_exists at 0x7f24d7d2f2a8>, u'date.autoformatter.day': <type 'unicode'>, u'date.autoformatter.hour': <type 'unicode'>, u'date.autoformatter.microsecond': <type 'unicode'>, u'date.autoformatter.minute': <type 'unicode'>, u'date.autoformatter.month': <type 'unicode'>, u'date.autoformatter.second': <type 'unicode'>, u'date.autoformatter.year': <type 'unicode'>, u'docstring.hardcopy': <function validate_bool at 0x7f24d7d2f320>, u'errorbar.capsize': <function validate_float at 0x7f24d7d2f488>, u'examples.directory': <type 'unicode'>, u'figure.autolayout': <function validate_bool at 0x7f24d7d2f320>, u'figure.dpi': <function validate_float at 0x7f24d7d2f488>, u'figure.edgecolor': <function validate_color at 0x7f24d7d2fcf8>, u'figure.facecolor': <function validate_color at 0x7f24d7d2fcf8>, u'figure.figsize': <matplotlib.rcsetup.validate_nseq_float object at 0x7f24d7d35550>, u'figure.frameon': <function validate_bool at 0x7f24d7d2f320>, u'figure.max_open_warning': <function validate_int at 0x7f24d7d2f758>, u'figure.subplot.bottom': <matplotlib.rcsetup.ValidateInterval object at 0x7f24d7d35610>, u'figure.subplot.hspace': <matplotlib.rcsetup.ValidateInterval object at 0x7f24d7d356d0>, u'figure.subplot.left': <matplotlib.rcsetup.ValidateInterval object at 0x7f24d7d35590>, u'figure.subplot.right': <matplotlib.rcsetup.ValidateInterval object at 0x7f24d7d355d0>, u'figure.subplot.top': <matplotlib.rcsetup.ValidateInterval object at 0x7f24d7d35650>, u'figure.subplot.wspace': <matplotlib.rcsetup.ValidateInterval object at 0x7f24d7d35690>, u'figure.titlesize': <function validate_fontsize at 0x7f24d7d2ff50>, u'figure.titleweight': <type 'unicode'>, u'font.cursive': <function unicodelist at 0x7f24d7d2fe60>, u'font.family': <function unicodelist at 0x7f24d7d2fe60>, u'font.fantasy': <function unicodelist at 0x7f24d7d2fe60>, u'font.monospace': <function unicodelist at 0x7f24d7d2fe60>, u'font.sans-serif': <function unicodelist at 0x7f24d7d2fe60>, u'font.serif': <function unicodelist at 0x7f24d7d2fe60>, u'font.size': <function validate_float at 0x7f24d7d2f488>, u'font.stretch': <type 'unicode'>, u'font.style': <type 'unicode'>, u'font.variant': <type 'unicode'>, u'font.weight': <type 'unicode'>, u'grid.alpha': <function validate_float at 0x7f24d7d2f488>, u'grid.color': <function validate_color at 0x7f24d7d2fcf8>, u'grid.linestyle': <function _validate_linestyle at 0x7f24d7d33d70>, u'grid.linewidth': <function validate_float at 0x7f24d7d2f488>, u'hatch.color': <function validate_color at 0x7f24d7d2fcf8>, u'hatch.linewidth': <function validate_float at 0x7f24d7d2f488>, u'hist.bins': <function validate_hist_bins at 0x7f24d7d33c80>, u'image.aspect': <function validate_aspect at 0x7f24d7d2fed8>, u'image.cmap': <type 'unicode'>, u'image.composite_image': <function validate_bool at 0x7f24d7d2f320>, u'image.interpolation': <type 'unicode'>, u'image.lut': <function validate_int at 0x7f24d7d2f758>, u'image.origin': <type 'unicode'>, u'image.resample': <function validate_bool at 0x7f24d7d2f320>, u'interactive': <function validate_bool at 0x7f24d7d2f320>, u'keymap.all_axes': <function unicodelist at 0x7f24d7d2fe60>, u'keymap.back': <function unicodelist at 0x7f24d7d2fe60>, u'keymap.forward': <function unicodelist at 0x7f24d7d2fe60>, u'keymap.fullscreen': <function unicodelist at 0x7f24d7d2fe60>, u'keymap.grid': <function unicodelist at 0x7f24d7d2fe60>, u'keymap.grid_minor': <function unicodelist at 0x7f24d7d2fe60>, u'keymap.home': <function unicodelist at 0x7f24d7d2fe60>, u'keymap.pan': <function unicodelist at 0x7f24d7d2fe60>, u'keymap.quit': <function unicodelist at 0x7f24d7d2fe60>, u'keymap.quit_all': <function unicodelist at 0x7f24d7d2fe60>, u'keymap.save': <function unicodelist at 0x7f24d7d2fe60>, u'keymap.xscale': <function unicodelist at 0x7f24d7d2fe60>, u'keymap.yscale': <function unicodelist at 0x7f24d7d2fe60>, u'keymap.zoom': <function unicodelist at 0x7f24d7d2fe60>, u'legend.borderaxespad': <function validate_float at 0x7f24d7d2f488>, u'legend.borderpad': <function validate_float at 0x7f24d7d2f488>, u'legend.columnspacing': <function validate_float at 0x7f24d7d2f488>, u'legend.edgecolor': <function validate_color_or_inherit at 0x7f24d7d2f9b0>, u'legend.facecolor': <function validate_color_or_inherit at 0x7f24d7d2f9b0>, u'legend.fancybox': <function validate_bool at 0x7f24d7d2f320>, u'legend.fontsize': <function validate_fontsize at 0x7f24d7d2ff50>, u'legend.framealpha': <function validate_float_or_None at 0x7f24d7d2f578>, u'legend.frameon': <function validate_bool at 0x7f24d7d2f320>, u'legend.handleheight': <function validate_float at 0x7f24d7d2f488>, u'legend.handlelength': <function validate_float at 0x7f24d7d2f488>, u'legend.handletextpad': <function validate_float at 0x7f24d7d2f488>, u'legend.labelspacing': <function validate_float at 0x7f24d7d2f488>, u'legend.loc': <matplotlib.rcsetup.ValidateInStrings object at 0x7f24d7d30fd0>, u'legend.markerscale': <function validate_float at 0x7f24d7d2f488>, u'legend.numpoints': <function validate_int at 0x7f24d7d2f758>, u'legend.scatterpoints': <function validate_int at 0x7f24d7d2f758>, u'legend.shadow': <function validate_bool at 0x7f24d7d2f320>, u'lines.antialiased': <function validate_bool at 0x7f24d7d2f320>, u'lines.color': <function validate_color at 0x7f24d7d2fcf8>, u'lines.dash_capstyle': <matplotlib.rcsetup.ValidateInStrings object at 0x7f24d7d30e90>, u'lines.dash_joinstyle': <matplotlib.rcsetup.ValidateInStrings object at 0x7f24d7d30dd0>, u'lines.dashdot_pattern': <matplotlib.rcsetup.validate_nseq_float object at 0x7f24d7d35390>, u'lines.dashed_pattern': <matplotlib.rcsetup.validate_nseq_float object at 0x7f24d7d35350>, u'lines.dotted_pattern': <matplotlib.rcsetup.validate_nseq_float object at 0x7f24d7d353d0>, u'lines.linestyle': <function _validate_linestyle at 0x7f24d7d33d70>, u'lines.linewidth': <function validate_float at 0x7f24d7d2f488>, u'lines.marker': <type 'unicode'>, u'lines.markeredgewidth': <function validate_float at 0x7f24d7d2f488>, u'lines.markersize': <function validate_float at 0x7f24d7d2f488>, u'lines.scale_dashes': <function validate_bool at 0x7f24d7d2f320>, u'lines.solid_capstyle': <matplotlib.rcsetup.ValidateInStrings object at 0x7f24d7d30e90>, u'lines.solid_joinstyle': <matplotlib.rcsetup.ValidateInStrings object at 0x7f24d7d30dd0>, u'markers.fillstyle': <matplotlib.rcsetup.ValidateInStrings object at 0x7f24d7d30f10>, u'mathtext.bf': <function validate_font_properties at 0x7f24d7d330c8>, u'mathtext.cal': <function validate_font_properties at 0x7f24d7d330c8>, u'mathtext.default': <matplotlib.rcsetup.ValidateInStrings object at 0x7f24d7d30cd0>, u'mathtext.fallback_to_cm': <function validate_bool at 0x7f24d7d2f320>, u'mathtext.fontset': <matplotlib.rcsetup.ValidateInStrings object at 0x7f24d7d30c90>, u'mathtext.it': <function validate_font_properties at 0x7f24d7d330c8>, u'mathtext.rm': <function validate_font_properties at 0x7f24d7d330c8>, u'mathtext.sf': <function validate_font_properties at 0x7f24d7d330c8>, u'mathtext.tt': <function validate_font_properties at 0x7f24d7d330c8>, u'nbagg.transparent': <function validate_bool at 0x7f24d7d2f320>, u'patch.antialiased': <function validate_bool at 0x7f24d7d2f320>, u'patch.edgecolor': <function validate_color at 0x7f24d7d2fcf8>, u'patch.facecolor': <function validate_color at 0x7f24d7d2fcf8>, u'patch.force_edgecolor': <function validate_bool at 0x7f24d7d2f320>, u'patch.linewidth': <function validate_float at 0x7f24d7d2f488>, u'path.effects': <function validate_any at 0x7f24d7d2f1b8>, u'path.simplify': <function validate_bool at 0x7f24d7d2f320>, u'path.simplify_threshold': <matplotlib.rcsetup.ValidateInterval object at 0x7f24d7d35710>, u'path.sketch': <function validate_sketch at 0x7f24d7d33848>, u'path.snap': <function validate_bool at 0x7f24d7d2f320>, u'pdf.compression': <function validate_int at 0x7f24d7d2f758>, u'pdf.fonttype': <function validate_fonttype at 0x7f24d7d2f848>, u'pdf.inheritcolor': <function validate_bool at 0x7f24d7d2f320>, u'pdf.use14corefonts': <function validate_bool at 0x7f24d7d2f320>, u'pgf.debug': <function validate_bool at 0x7f24d7d2f320>, u'pgf.preamble': <function unicodelist at 0x7f24d7d2fe60>, u'pgf.rcfonts': <function validate_bool at 0x7f24d7d2f320>, u'pgf.texsystem': <matplotlib.rcsetup.ValidateInStrings object at 0x7f24d7d350d0>, u'plugins.directory': <type 'unicode'>, u'polaraxes.grid': <function validate_bool at 0x7f24d7d2f320>, u'ps.distiller.res': <function validate_int at 0x7f24d7d2f758>, u'ps.fonttype': <function validate_fonttype at 0x7f24d7d2f848>, u'ps.papersize': <matplotlib.rcsetup.ValidateInStrings object at 0x7f24d7d30d90>, u'ps.useafm': <function validate_bool at 0x7f24d7d2f320>, u'ps.usedistiller': <function validate_ps_distiller at 0x7f24d7d33230>, u'savefig.bbox': <function validate_bbox at 0x7f24d7d337d0>, u'savefig.directory': <type 'unicode'>, u'savefig.dpi': <function validate_dpi at 0x7f24d7d2f6e0>, u'savefig.edgecolor': <function validate_color at 0x7f24d7d2fcf8>, u'savefig.facecolor': <function validate_color at 0x7f24d7d2fcf8>, u'savefig.format': <function update_savefig_format at 0x7f24d7d331b8>, u'savefig.frameon': <function validate_bool at 0x7f24d7d2f320>, u'savefig.jpeg_quality': <function validate_int at 0x7f24d7d2f758>, u'savefig.orientation': <matplotlib.rcsetup.ValidateInStrings object at 0x7f24d7d30c10>, u'savefig.pad_inches': <function validate_float at 0x7f24d7d2f488>, u'savefig.transparent': <function validate_bool at 0x7f24d7d2f320>, u'scatter.marker': <type 'unicode'>, u'svg.fonttype': <matplotlib.rcsetup.ValidateInStrings object at 0x7f24d7d35090>, u'svg.hashsalt': <function validate_string_or_None at 0x7f24d7d2f5f0>, u'svg.image_inline': <function validate_bool at 0x7f24d7d2f320>, u'text.antialiased': <function validate_bool at 0x7f24d7d2f320>, u'text.color': <function validate_color at 0x7f24d7d2fcf8>, u'text.hinting': <function validate_hinting at 0x7f24d7d33758>, u'text.hinting_factor': <function validate_int at 0x7f24d7d2f758>, u'text.latex.preamble': <function unicodelist at 0x7f24d7d2fe60>, u'text.latex.preview': <function validate_bool at 0x7f24d7d2f320>, u'text.latex.unicode': <function validate_bool at 0x7f24d7d2f320>, u'text.usetex': <function validate_bool at 0x7f24d7d2f320>, u'timezone': <type 'unicode'>, u'tk.window_focus': <function validate_bool at 0x7f24d7d2f320>, u'toolbar': <function validate_toolbar at 0x7f24d7d2f938>, u'verbose.fileo': <type 'unicode'>, u'verbose.level': <matplotlib.rcsetup.ValidateInStrings object at 0x7f24d7d30d10>, u'webagg.open_in_browser': <function validate_bool at 0x7f24d7d2f320>, u'webagg.port': <function validate_int at 0x7f24d7d2f758>, u'webagg.port_retries': <function validate_int at 0x7f24d7d2f758>, u'xtick.alignment': <matplotlib.rcsetup.ValidateInStrings object at 0x7f24d7d30d50>, u'xtick.bottom': <function validate_bool at 0x7f24d7d2f320>, u'xtick.color': <function validate_color at 0x7f24d7d2fcf8>, u'xtick.direction': <type 'unicode'>, u'xtick.labelsize': <function validate_fontsize at 0x7f24d7d2ff50>, u'xtick.major.bottom': <function validate_bool at 0x7f24d7d2f320>, u'xtick.major.pad': <function validate_float at 0x7f24d7d2f488>, u'xtick.major.size': <function validate_float at 0x7f24d7d2f488>, u'xtick.major.top': <function validate_bool at 0x7f24d7d2f320>, u'xtick.major.width': <function validate_float at 0x7f24d7d2f488>, u'xtick.minor.bottom': <function validate_bool at 0x7f24d7d2f320>, u'xtick.minor.pad': <function validate_float at 0x7f24d7d2f488>, u'xtick.minor.size': <function validate_float at 0x7f24d7d2f488>, u'xtick.minor.top': <function validate_bool at 0x7f24d7d2f320>, u'xtick.minor.visible': <function validate_bool at 0x7f24d7d2f320>, u'xtick.minor.width': <function validate_float at 0x7f24d7d2f488>, u'xtick.top': <function validate_bool at 0x7f24d7d2f320>, u'ytick.alignment': <matplotlib.rcsetup.ValidateInStrings object at 0x7f24d7d30d50>, u'ytick.color': <function validate_color at 0x7f24d7d2fcf8>, u'ytick.direction': <type 'unicode'>, u'ytick.labelsize': <function validate_fontsize at 0x7f24d7d2ff50>, u'ytick.left': <function validate_bool at 0x7f24d7d2f320>, u'ytick.major.left': <function validate_bool at 0x7f24d7d2f320>, u'ytick.major.pad': <function validate_float at 0x7f24d7d2f488>, u'ytick.major.right': <function validate_bool at 0x7f24d7d2f320>, u'ytick.major.size': <function validate_float at 0x7f24d7d2f488>, u'ytick.major.width': <function validate_float at 0x7f24d7d2f488>, u'ytick.minor.left': <function validate_bool at 0x7f24d7d2f320>, u'ytick.minor.pad': <function validate_float at 0x7f24d7d2f488>, u'ytick.minor.right': <function validate_bool at 0x7f24d7d2f320>, u'ytick.minor.size': <function validate_float at 0x7f24d7d2f488>, u'ytick.minor.visible': <function validate_bool at 0x7f24d7d2f320>, u'ytick.minor.width': <function validate_float at 0x7f24d7d2f488>, u'ytick.right': <function validate_bool at 0x7f24d7d2f320>}
matplotlib.rc_params(fail_on_error=False)

Return a matplotlib.RcParams instance from the default matplotlib rc file.

matplotlib.rc_params_from_file(fname, fail_on_error=False, use_default_template=True)

Return matplotlib.RcParams from the contents of the given file.

Parameters:

fname : str

Name of file parsed for matplotlib settings.

fail_on_error : bool

If True, raise an error when the parser fails to convert a parameter.

use_default_template : bool

If True, initialize with default parameters before updating with those in the given file. If False, the configuration class only contains the parameters specified in the file. (Useful for updating dicts.)

matplotlib.matplotlib_fname()

Get the location of the config file.

The file location is determined in the following order

  • $PWD/matplotlibrc

  • $MATPLOTLIBRC if it is a file

  • $MATPLOTLIBRC/matplotlibrc

  • $MPLCONFIGDIR/matplotlibrc

  • On Linux,

    • $XDG_CONFIG_HOME/matplotlib/matplotlibrc (if $XDG_CONFIG_HOME is defined)
    • or $HOME/.config/matplotlib/matplotlibrc (if $XDG_CONFIG_HOME is not defined)
  • On other platforms,

    • $HOME/.matplotlib/matplotlibrc if $HOME is defined.
  • Lastly, it looks in $MATPLOTLIBDATA/matplotlibrc for a system-defined copy.

matplotlib.interactive(b)

Set interactive mode to boolean b.

If b is True, then draw after every plotting command, e.g., after xlabel

matplotlib.is_interactive()

Return true if plot mode is interactive