matplotlib.rcsetup#

The rcsetup module contains the validation code for customization usingMatplotlib's rc settings.

Each rc setting is assigned a function used to validate any attempted changesto that setting. The validation functions are defined in the rcsetup module,and are used to construct the rcParams global object which stores the settingsand is referenced throughout Matplotlib.

The default values of the rc settings are set in the default matplotlibrc file.Any additions or deletions to the parameter set listed here should also bepropagated to thelib/matplotlib/mpl-data/matplotlibrc in Matplotlib'sroot source directory.

classmatplotlib.rcsetup.ValidateInStrings(key,valid,ignorecase=False,*,_deprecated_since=None)[source]#

Bases:object

valid is a list of legal strings.

matplotlib.rcsetup.cycler(*args,**kwargs)[source]#

Create aCycler object much likecycler.cycler(),but includes input validation.

Call signatures:

cycler(cycler)cycler(label=values,label2=values2,...)cycler(label,values)

Form 1 copies a givenCycler object.

Form 2 creates aCycler which cycles over one or moreproperties simultaneously. If multiple properties are given, theirvalue lists must have the same length.

Form 3 creates aCycler for a single property. This formexists for compatibility with the original cycler. Its use isdiscouraged in favor of the kwarg form, i.e.cycler(label=values).

Parameters:
cyclerCycler

Copy constructor for Cycler.

labelstr

The property key. Must be a validArtist property.For example, 'color' or 'linestyle'. Aliases are allowed,such as 'c' for 'color' and 'lw' for 'linewidth'.

valuesiterable

Finite-length iterable of the property values. These valuesare validated and will raise a ValueError if invalid.

Returns:
Cycler

A newCycler for the given properties.

Examples

Creating a cycler for a single property:

>>>c=cycler(color=['red','green','blue'])

Creating a cycler for simultaneously cycling over multiple properties(e.g. red circle, green plus, blue cross):

>>>c=cycler(color=['red','green','blue'],...marker=['o','+','x'])
matplotlib.rcsetup.validate_any(s)[source]#
matplotlib.rcsetup.validate_anylist(s)[source]#
matplotlib.rcsetup.validate_aspect(s)[source]#
matplotlib.rcsetup.validate_axisbelow(s)[source]#
matplotlib.rcsetup.validate_backend(s)[source]#
matplotlib.rcsetup.validate_bbox(s)[source]#
matplotlib.rcsetup.validate_bool(b)[source]#

Convert b tobool or raise.

matplotlib.rcsetup.validate_color(s)[source]#

Return a valid color arg.

matplotlib.rcsetup.validate_color_for_prop_cycle(s)[source]#
matplotlib.rcsetup.validate_color_or_auto(s)[source]#
matplotlib.rcsetup.validate_color_or_inherit(s)[source]#

Return a valid color arg.

matplotlib.rcsetup.validate_colorlist(s)[source]#

return a list of colorspecs

matplotlib.rcsetup.validate_cycler(s)[source]#

Return a Cycler object from a string repr or the object itself.

matplotlib.rcsetup.validate_dashlist(s)[source]#

return a list of floats

matplotlib.rcsetup.validate_dpi(s)[source]#

Confirm s is string 'figure' or convert s to float or raise.

matplotlib.rcsetup.validate_fillstylelist(s)[source]#
matplotlib.rcsetup.validate_float(s)[source]#
matplotlib.rcsetup.validate_float_or_None(s)[source]#
matplotlib.rcsetup.validate_floatlist(s)[source]#

return a list of floats

matplotlib.rcsetup.validate_font_properties(s)[source]#
matplotlib.rcsetup.validate_fontsize(s)[source]#
matplotlib.rcsetup.validate_fontsize_None(s)[source]#
matplotlib.rcsetup.validate_fontsizelist(s)[source]#
matplotlib.rcsetup.validate_fontstretch(s)[source]#
matplotlib.rcsetup.validate_fonttype(s)[source]#

Confirm that this is a Postscript or PDF font type that we know how toconvert to.

matplotlib.rcsetup.validate_fontweight(s)[source]#
matplotlib.rcsetup.validate_hatch(s)[source]#

Validate a hatch pattern.A hatch pattern string can have any sequence of the followingcharacters:\/|-+*.xoO.

matplotlib.rcsetup.validate_hatchlist(s)[source]#

Validate a hatch pattern.A hatch pattern string can have any sequence of the followingcharacters:\/|-+*.xoO.

matplotlib.rcsetup.validate_hist_bins(s)[source]#
matplotlib.rcsetup.validate_int(s)[source]#
matplotlib.rcsetup.validate_int_or_None(s)[source]#
matplotlib.rcsetup.validate_markevery(s)[source]#

Validate the markevery property of a Line2D object.

Parameters:
sNone, int, (int, int), slice, float, (float, float), or list[int]
Returns:
None, int, (int, int), slice, float, (float, float), or list[int]
matplotlib.rcsetup.validate_markeverylist(s)[source]#

Validate the markevery property of a Line2D object.

Parameters:
sNone, int, (int, int), slice, float, (float, float), or list[int]
Returns:
None, int, (int, int), slice, float, (float, float), or list[int]
matplotlib.rcsetup.validate_ps_distiller(s)[source]#
matplotlib.rcsetup.validate_sketch(s)[source]#
matplotlib.rcsetup.validate_string(s)[source]#
matplotlib.rcsetup.validate_string_or_None(s)[source]#
matplotlib.rcsetup.validate_stringlist(s)[source]#

return a list of strings

matplotlib.rcsetup.validate_whiskers(s)[source]#
On this page