Matplotlib configuration - rcParams#

Matplotlib's configuration parameters (rcParams) control the behavior and appearance of plots. These parameters are stored in a dict-like variable called matplotlib.rcParams (also accessible via plt.rcParams).

The following is a comprehensive reference of all available rcParams and their default values.

Backends#

webagg.portint = 8988

The server port in the WebAgg backend.

webagg.addressstr = '127.0.0.1'

The server address in the WebAgg backend.

webagg.port_retriesint = 50

If webagg.port is unavailable, a number of other random ports will be tried until one that is available is found.

webagg.open_in_browserbool = True

When True, open the web browser to the plot that is shown.

backend_fallbackbool = True

If you are running pyplot inside a GUI and your backend choice conflicts, we will automatically try to find a compatible one for you if backend_fallback is True

interactivebool = False

no description

figure.hookslist[str] = []

list of dotted.module.name:dotted.callable.name

toolbar'None' | 'toolbar2' | 'toolmanager' = 'toolbar2'

{None, toolbar2, toolmanager}

timezonestr = 'UTC'

a pytz timezone string, e.g., US/Central or Europe/Paris

Lines#

Default line properties. Some plotting functions such as plot may override them with information from the property cycle; see Styling with cycler.

lines.linewidthfloat = 1.5

The default line width in points.

lines.linestyle_LineStyleType = '-'

The default line style.

lines.colorcolor = 'C0'

The default line color.

lines.marker_MarkerType = 'None'

The default marker type.

lines.markerfacecolorcolor or "auto" = 'auto'

The default marker face color; use 'auto' to use 'lines.color'.

lines.markeredgecolorcolor or "auto" = 'auto'

The default marker edge color; use 'auto' to use 'lines.color'.

lines.markeredgewidthfloat = 1.0

The default width of the marker edge stroke, in points.

lines.markersizefloat = 6.0

The default marker size, in points.

lines.dash_joinstyleJoinStyle = 'round'

The join style used where dashed line segments meet.

lines.dash_capstyleCapStyle = 'butt'

The cap style used at the ends of dashed line segments.

lines.solid_joinstyleJoinStyle = 'round'

The join style used where solid line segments meet.

lines.solid_capstyleCapStyle = 'projecting'

The cap style used at the ends of solid lines.

lines.antialiasedbool = True

Whether to render lines with antialiasing.

lines.dashed_patternlist[float] = [3.7, 1.6]

The dash pattern for linestyle 'dashed'.

lines.dashdot_patternlist[float] = [6.4, 1.6, 1.0, 1.6]

The dash pattern for linestyle 'dashdot'.

lines.dotted_patternlist[float] = [1.0, 1.65]

The dash pattern for linestyle 'dotted'.

lines.scale_dashesbool = True

Whether dash lengths are scaled by the line width.

markers.fillstyle'full' | 'left' | 'right' | 'bottom' | 'top' | 'none' = 'full'

The marker fill style.

pcolor.shading'auto' | 'flat' | 'nearest' | 'gouraud' = 'auto'

The default shading mode for pcolor and pcolormesh.

pcolormesh.snapbool = True

Whether to snap the mesh to pixel boundaries. This is provided solely to allow old test images to remain unchanged. Set to False to obtain the previous behavior.

Patches#

patch.linewidthfloat = 1.0

The patch edge width, in points.

patch.facecolorcolor = 'C0'

The patch face color.

patch.edgecolorcolor = 'black'

By default, Patches and Collections do not draw edges. This value is only used if facecolor is "none" (an Artist without facecolor and edgecolor would be invisible) or if patch.force_edgecolor is True.

patch.force_edgecolorbool = False

By default, Patches and Collections do not draw edges. Set this to True to draw edges with patch.edgecolor as the default edgecolor. This is mainly relevant for styles.

patch.antialiasedbool = True

Whether to render patches with antialiasing.

Hatches#

hatch.colorcolor or "edge" = 'edge'

The color of hatch strokes.

hatch.linewidthfloat = 1.0

The width of hatch strokes, in points.

Boxplot#

boxplot.notchbool = False

Whether to draw notches around the median.

boxplot.verticalbool = True

Whether to draw vertical boxplots.

boxplot.whiskersfloat | tuple[float, float] = 1.5

The whisker length as a multiple of the interquartile range, or a (lower, upper) pair.

boxplot.bootstrapint | None = None

The number of bootstrap resamples used to estimate boxplot notches; None disables bootstrapping.

boxplot.patchartistbool = False

Whether boxplots should be drawn as patches instead of line artists.

boxplot.showmeansbool = False

Whether to draw the mean on boxplots.

boxplot.showcapsbool = True

Whether to draw caps on the whiskers.

boxplot.showboxbool = True

Whether to draw the box around the quartiles.

boxplot.showfliersbool = True

Whether to draw flier markers for outliers.

boxplot.meanlinebool = False

Whether to draw the mean as a line instead of a marker.

boxplot.flierprops.colorcolor = 'black'

The color of the flier markers.

boxplot.flierprops.marker_MarkerType = 'o'

The marker style of flier markers.

boxplot.flierprops.markerfacecolorcolor or "auto" = 'none'

The face color of flier markers.

boxplot.flierprops.markeredgecolorcolor = 'black'

The edge color of flier markers.

boxplot.flierprops.markeredgewidthfloat = 1.0

The width of the flier marker edge, in points.

boxplot.flierprops.markersizefloat = 6.0

The flier marker size, in points.

boxplot.flierprops.linestyle_LineStyleType = 'none'

The line style of flier markers.

boxplot.flierprops.linewidthfloat = 1.0

The line width of flier markers, in points.

boxplot.boxprops.colorcolor = 'black'

The box outline color.

boxplot.boxprops.linewidthfloat = 1.0

The box outline width, in points.

boxplot.boxprops.linestyle_LineStyleType = '-'

The box outline style.

boxplot.whiskerprops.colorcolor = 'black'

The whisker line color.

boxplot.whiskerprops.linewidthfloat = 1.0

The whisker line width, in points.

boxplot.whiskerprops.linestyle_LineStyleType = '-'

The whisker line style.

boxplot.capprops.colorcolor = 'black'

The cap line color.

boxplot.capprops.linewidthfloat = 1.0

The cap line width, in points.

boxplot.capprops.linestyle_LineStyleType = '-'

The cap line style.

boxplot.medianprops.colorcolor = 'C1'

The median line color.

boxplot.medianprops.linewidthfloat = 1.0

The median line width, in points.

boxplot.medianprops.linestyle_LineStyleType = '-'

The median line style.

boxplot.meanprops.colorcolor = 'C2'

The mean marker or line color.

boxplot.meanprops.marker_MarkerType = '^'

The marker style of the mean marker.

boxplot.meanprops.markerfacecolorcolor = 'C2'

The face color of the mean marker.

boxplot.meanprops.markeredgecolorcolor = 'C2'

The edge color of the mean marker.

boxplot.meanprops.markersizefloat = 6.0

The mean marker size, in points.

boxplot.meanprops.linestyle_LineStyleType = '--'

The line style of the mean marker or line.

boxplot.meanprops.linewidthfloat = 1.0

The line width of the mean marker or line, in points.

Font#

The font properties used by Text See https://matplotlib.org/stable/api/font_manager_api.html for more information on font properties. The 6 font properties used for font matching are given below with their default values.

font.familylist[str] = ['sans-serif']

A prioritized list of font families to try.

font.style'normal' | 'italic' | 'oblique' = 'normal'

The default font style.

font.variant'normal' | 'small-caps' = 'normal'

The default font variant.

font.weight_FontWeightType = 'normal'

The default font weight.

font.stretch_FontStretchType = 'normal'

The default font stretch.

font.sizefloat = 10.0

The default font size, in points.

font.seriflist[str] = ['DejaVu Serif', 'Bitstream Vera Serif', 'Computer Modern Roman', 'New Century Schoolbook', 'Century Schoolbook L', 'Utopia', 'ITC Bookman', 'Bookman', 'Nimbus Roman No9 L', 'Times New Roman', 'Times', 'Palatino', 'Charter', 'serif']

Fonts to be used for the generic "serif" font family specifier, in descending priority.

font.sans-seriflist[str] = ['DejaVu Sans', 'Bitstream Vera Sans', 'Computer Modern Sans Serif', 'Lucida Grande', 'Verdana', 'Geneva', 'Lucid', 'Arial', 'Helvetica', 'Avant Garde', 'sans-serif']

Fonts to be used for the generic "sans-serif" font family specifier, in descending priority.

font.cursivelist[str] = ['Apple Chancery', 'Textile', 'Zapf Chancery', 'Sand', 'Script MT', 'Felipa', 'Comic Neue', 'Comic Sans MS', 'cursive']

Fonts to be used for the generic "cursive" font family specifier, in descending priority.

font.fantasylist[str] = ['Chicago', 'Charcoal', 'Impact', 'Western', 'xkcd script', 'fantasy']

Fonts to be used for the generic "fantasy" font family specifier, in descending priority.

font.monospacelist[str] = ['DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Computer Modern Typewriter', 'Andale Mono', 'Nimbus Mono L', 'Courier New', 'Courier', 'Fixed', 'Terminal', 'monospace']

Fonts to be used for the generic "monospace" font family specifier, in descending priority.

font.enable_last_resortbool = True

If True, then Unicode Consortium's Last Resort font will be appended to all font selections. This ensures that there will always be a glyph displayed.

Text properties#

text.colorcolor = 'black'

The default text color.

text.languagestr | None = None

The language of the text in a format accepted by libraqm, namely a BCP47 language code. If None, then no particular language will be implied, and default font settings will be used.

text.hinting'default' | 'no_autohint' | 'force_autohint' | 'no_hinting' | 'auto' | 'native' | 'either' | 'none' = 'default'

FreeType hinting flag ("foo" corresponds to FT_LOAD_FOO); may be one of the following (Proprietary Matplotlib-specific synonyms are given in parentheses, but their use is discouraged): - default: Use the font's native hinter if possible, else FreeType's auto-hinter. ("either" is a synonym).- no_autohint: Use the font's native hinter if possible, else don't hint. ("native" is a synonym.)- force_autohint: Use FreeType's auto-hinter. ("auto" is a synonym.)- no_hinting: Disable hinting. ("none" is a synonym.)

text.hinting_factorint | None = None

[DEPRECATED] This setting has no effect.

text.kerning_factorint | None = None

[DEPRECATED] Specifies the scaling factor for kerning values. This is provided solely to allow old test images to remain unchanged. Set to 6 to obtain previous behavior. Values other than 0 or 6 have no defined meaning.

text.antialiasedbool = True

If True (default), the text will be antialiased. This only affects raster outputs.

text.parse_mathbool = True

Use mathtext if there is an even number of unescaped dollar signs.

Mathtext and LaTeX#

text.usetexbool = False

use latex for all text handling. The following fonts are supported through the usual rc parameter settings: new century schoolbook, bookman, times, palatino, zapf chancery, charter, serif, sans-serif, helvetica, avant garde, courier, monospace, computer modern roman, computer modern sans serif, computer modern typewriter

text.latex.engine'latex' | 'latex+dvipng' = 'latex'

The TeX engine/format to use. The following values are supported: - 'latex': The classic TeX engine (the current default). All backends render TeX's output by parsing the DVI output into glyphs and boxes and emitting those one by one. - 'latex+dvipng': The same as 'latex', with the exception that Agg-based backends rely on dvipng to rasterize TeX's output. This value was the default up to Matplotlib 3.10.

text.latex.preamblestr = ''

IMPROPER USE OF THIS FEATURE WILL LEAD TO LATEX FAILURES AND IS THEREFORE UNSUPPORTED. PLEASE DO NOT ASK FOR HELP IF THIS FEATURE DOES NOT DO WHAT YOU EXPECT IT TO. text.latex.preamble is a single line of LaTeX code that will be passed on to the LaTeX system. It may contain any code that is valid for the LaTeX "preamble", i.e. between the "documentclass" and "begin{document}" statements. Note that it has to be put on a single line, which may become quite long. The following packages are always loaded with usetex, so beware of package collisions: color, fix-cm, geometry, graphicx, textcomp. PostScript (PSNFSS) font packages may also be loaded, depending on your font settings.

mathtext.fontset'dejavusans' | 'dejavuserif' | 'cm' | 'stix' | 'stixsans' | 'custom' = 'dejavusans'

Should be 'dejavusans' (default), 'dejavuserif', 'cm' (Computer Modern), 'stix', 'stixsans' or 'custom'

mathtext.bfstr = 'sans:bold'

The font config pattern for bold math text.

mathtext.bfitstr = 'sans:italic:bold'

The font config pattern for bold italic math text.

mathtext.calstr = 'cursive'

The font config pattern for calligraphic math text.

mathtext.itstr = 'sans:italic'

The font config pattern for italic math text.

mathtext.rmstr = 'sans'

The font config pattern for roman math text.

mathtext.sfstr = 'sans'

The font config pattern for sans-serif math text.

mathtext.ttstr = 'monospace'

The font config pattern for monospace math text.

mathtext.fallbacktyping.Optional[typing.Literal['cm', 'stix', 'stixsans']] = 'cm'

Select fallback font from ['cm' (Computer Modern), 'stix', 'stixsans'] when a symbol cannot be found in one of the custom math fonts. Select 'None' to not perform fallback and replace the missing character by a dummy symbol.

mathtext.default'rm' | 'cal' | 'bfit' | 'it' | 'tt' | 'sf' | 'bf' | 'default' | 'bb' | 'frak' | 'scr' | 'regular' | 'normal' = 'normal'

The default font for math-formatted text. Can be any of the LaTeX font names, including the special name "regular" for the same font used in regular text.

Axes#

axes.facecolorcolor = 'white'

The axes background color.

axes.edgecolorcolor = 'black'

The axes edge color.

axes.linewidthfloat = 0.8

The axes edge line width.

axes.gridbool = False

Whether to display the grid.

axes.grid.axis'x' | 'y' | 'both' = 'both'

Which axis the grid should apply to.

axes.grid.which'minor' | 'both' | 'major' = 'major'

Whether to draw grid lines at major ticks, minor ticks, or both.

axes.titlelocation'left' | 'center' | 'right' = 'center'

The alignment of the axes title.

axes.titlesize_FontSizeType = 'large'

The font size of the axes title.

axes.titleweight_FontWeightType = 'normal'

The font weight of the axes title.

axes.titlecolorcolor or "auto" = 'auto'

The color of the axes title; auto falls back to 'text.color'.

axes.titleyfloat | None = None

The vertical title position in axes coordinates; None enables automatic placement.

axes.titlepadfloat = 6.0

The padding between the axes and title, in points.

axes.labelsize_FontSizeType = 'medium'

The font size of the x and y labels.

axes.labelpadfloat = 4.0

The space between the axis label and the axis, in points.

axes.labelweight_FontWeightType = 'normal'

The font weight of the x and y labels.

axes.labelcolorcolor = 'black'

The color of the axis labels.

axes.axisbelowtyping.Union[bool, typing.Literal['line']] = 'line'

draw axis gridlines and ticks: - below patches (True) - above patches but below lines ('line') - above all (False)

axes.formatter.limitslist[int] = [-5, 6]

use scientific notation if log10 of the axis range is smaller than the first or larger than the second

axes.formatter.use_localebool = False

When True, format tick labels according to the user's locale. For example, use ',' as a decimal separator in the fr_FR locale.

axes.formatter.use_mathtextbool = False

When True, use mathtext for scientific notation.

axes.formatter.min_exponentint = 0

minimum exponent to format in scientific notation

axes.formatter.useoffsetbool = True

If True, the tick label formatter will default to labeling ticks relative to an offset when the data range is small compared to the minimum absolute value of the data.

axes.formatter.offset_thresholdint = 4

When useoffset is True, the offset will be used when it can remove at least this number of significant digits from tick labels.

axes.spines.leftbool = True

display axis spines

axes.spines.bottombool = True

Whether to draw the bottom axis spine.

axes.spines.topbool = True

Whether to draw the top axis spine.

axes.spines.rightbool = True

Whether to draw the right axis spine.

axes.unicode_minusbool = True

use Unicode for the minus symbol rather than hyphen. See https://en.wikipedia.org/wiki/Plus_and_minus_signs#Character_codes

axes.prop_cycleCycler = cycler('color', [(0.12156862745098039, 0.4666666666666667, 0.7058823529411765), (1.0, 0.4980392156862745, 0.054901960784313725), (0.17254901960784313, 0.6274509803921569, 0.17254901960784313), (0.8392156862745098, 0.15294117647058825, 0.1568627450980392), (0.5803921568627451, 0.403921568627451, 0.7411764705882353), (0.5490196078431373, 0.33725490196078434, 0.29411764705882354), (0.8901960784313725, 0.4666666666666667, 0.7607843137254902), (0.4980392156862745, 0.4980392156862745, 0.4980392156862745), (0.7372549019607844, 0.7411764705882353, 0.13333333333333333), (0.09019607843137255, 0.7450980392156863, 0.8117647058823529)])

The property cycle used by plotting functions to vary artist properties on subsequent calls.

axes.xmarginfloat = 0.05

x margin. See margins

axes.ymarginfloat = 0.05

y margin. See margins

axes.zmarginfloat = 0.05

z margin. See margins

axes.autolimit_mode'data' | 'round_numbers' = 'data'

If "data", use axes.xmargin and axes.ymargin as is. If "round_numbers", after application of margins, axis limits are further expanded to the nearest "round" number.

Polar Axes#

polaraxes.gridbool = True

display grid on polar axes

3D Axes#

axes3d.gridbool = True

display grid on 3D axes

axes3d.automarginbool = False

automatically add margin when manually setting 3D axis limits

axes3d.xaxis.panecolorcolor = (0.95, 0.95, 0.95, 0.5)

background pane on 3D axes

axes3d.yaxis.panecolorcolor = (0.9, 0.9, 0.9, 0.5)

background pane on 3D axes

axes3d.zaxis.panecolorcolor = (0.925, 0.925, 0.925, 0.5)

background pane on 3D axes

axes3d.depthshadebool = True

depth shade for 3D scatter plots

axes3d.depthshade_minalphafloat = 0.3

minimum alpha value for depth shading

axes3d.mouserotationstyle'azel' | 'trackball' | 'sphere' | 'arcball' = 'arcball'

The way mouse movements are interpreted as 3D rotations. See also Rotation with mouse.

axes3d.trackballsizefloat = 0.667

trackball diameter, in units of the Axes bbox

axes3d.trackballborderfloat = 0.2

trackball border width, in units of the Axes bbox (only for 'sphere' and 'arcball' style)

Axis#

axes3d.snap_rotationfloat = 5.0

Snap angle (in degrees) for 3D rotation when holding Control.

xaxis.labellocation'left' | 'center' | 'right' = 'center'

alignment of the xaxis label: {left, right, center}

yaxis.labellocation'bottom' | 'center' | 'top' = 'center'

alignment of the yaxis label: {bottom, top, center}

Dates#

Default properties for date tick labels. These are used by the AutoDateFormatter when the appropriate time unit is detected.See https://matplotlib.org/stable/api/dates_api.html#date-formatters for more information.

date.autoformatter.yearstr = '%Y'

The strftime format for year ticks.

date.autoformatter.monthstr = '%Y-%m'

The strftime format for month ticks.

date.autoformatter.daystr = '%Y-%m-%d'

The strftime format for day ticks.

date.autoformatter.hourstr = '%m-%d %H'

The strftime format for hour ticks.

date.autoformatter.minutestr = '%d %H:%M'

The strftime format for minute ticks.

date.autoformatter.secondstr = '%H:%M:%S'

The strftime format for second ticks.

date.autoformatter.microsecondstr = '%M:%S.%f'

The strftime format for microsecond ticks.

date.epochstr = '1970-01-01T00:00:00'

The reference date for Matplotlib's internal date representation. See Date precision and epochs.

date.converter'auto' | 'concise' = 'auto'

The date converter to use.

date.interval_multiplesbool = True

Whether the automatic date converter should use interval_multiples.

Ticks#

xtick.topbool = False

draw ticks on the top side

xtick.bottombool = True

draw ticks on the bottom side

xtick.labeltopbool = False

draw label on the top

xtick.labelbottombool = True

draw label on the bottom

xtick.major.sizefloat = 3.5

major tick size in points

xtick.minor.sizefloat = 2.0

minor tick size in points

xtick.major.widthfloat = 0.8

major tick width in points

xtick.minor.widthfloat = 0.6

minor tick width in points

xtick.major.padfloat = 3.5

distance to major tick label in points

xtick.minor.padfloat = 3.4

distance to the minor tick label in points

xtick.colorcolor = 'black'

color of the ticks

xtick.labelcolorcolor or "inherit" = 'inherit'

color of the tick labels or inherit from xtick.color

xtick.labelsize_FontSizeType = 'medium'

font size of the tick labels

xtick.direction'in' | 'out' | 'inout' = 'out'

direction: {in, out, inout}

xtick.minor.visiblebool = False

visibility of minor ticks on x-axis

xtick.major.topbool = True

draw x axis top major ticks

xtick.major.bottombool = True

draw x axis bottom major ticks

xtick.minor.topbool = True

draw x axis top minor ticks

xtick.minor.bottombool = True

draw x axis bottom minor ticks

xtick.minor.ndivstyping.Union[int, typing.Literal['auto']] = 'auto'

number of minor ticks between the major ticks on x-axis

xtick.alignment'center' | 'right' | 'left' = 'center'

alignment of xticks

ytick.leftbool = True

draw ticks on the left side

ytick.rightbool = False

draw ticks on the right side

ytick.labelleftbool = True

draw tick labels on the left side

ytick.labelrightbool = False

draw tick labels on the right side

ytick.major.sizefloat = 3.5

major tick size in points

ytick.minor.sizefloat = 2.0

minor tick size in points

ytick.major.widthfloat = 0.8

major tick width in points

ytick.minor.widthfloat = 0.6

minor tick width in points

ytick.major.padfloat = 3.5

distance to major tick label in points

ytick.minor.padfloat = 3.4

distance to the minor tick label in points

ytick.colorcolor = 'black'

color of the ticks

ytick.labelcolorcolor or "inherit" = 'inherit'

color of the tick labels or inherit from ytick.color

ytick.labelsize_FontSizeType = 'medium'

font size of the tick labels

ytick.direction'in' | 'out' | 'inout' = 'out'

direction: {in, out, inout}

ytick.minor.visiblebool = False

visibility of minor ticks on y-axis

ytick.major.leftbool = True

draw y axis left major ticks

ytick.major.rightbool = True

draw y axis right major ticks

ytick.minor.leftbool = True

draw y axis left minor ticks

ytick.minor.rightbool = True

draw y axis right minor ticks

ytick.minor.ndivstyping.Union[int, typing.Literal['auto']] = 'auto'

number of minor ticks between the major ticks on y-axis

ytick.alignment'center' | 'top' | 'bottom' | 'baseline' | 'center_baseline' = 'center_baseline'

alignment of yticks

Grid#

grid.colorcolor = '#b0b0b0'

The default grid line color.

grid.linestyle_LineStyleType = '-'

The default grid line style.

grid.linewidthfloat = 0.8

The default grid line width, in points.

grid.alphafloat = 1.0

The default grid line transparency, between 0.0 (fully transparent) and 1.0 (opaque).

grid.major.colorcolor or None = None

If None defaults to grid.color

grid.major.linestyle_LineStyleType | None = None

If None defaults to grid.linestyle

grid.major.linewidthfloat | None = None

If None defaults to grid.linewidth

grid.major.alphafloat | None = None

If None defaults to grid.alpha

grid.minor.colorcolor or None = None

If None defaults to grid.color

grid.minor.linestyle_LineStyleType | None = None

If None defaults to grid.linestyle

grid.minor.linewidthfloat | None = None

If None defaults to grid.linewidth

grid.minor.alphafloat | None = None

If None defaults to grid.alpha

Legend#

legend.locstr | int | tuple[float, float] = 'best'

The legend location. See the loc parameter in Axes.legend.

legend.frameonbool = True

if True, draw the legend on a background patch

legend.framealphafloat | None = 0.8

legend patch transparency

legend.facecolorcolor or "inherit" = 'inherit'

inherit from axes.facecolor; or color spec

legend.edgecolorcolor or "inherit" = '0.8'

background patch boundary color

legend.linewidthfloat | None = None

line width of the legend frame, None means inherit from patch.linewidth

legend.fancyboxbool = True

if True, use a rounded box for the legend background, else a rectangle

legend.shadowbool = False

if True, give background a shadow effect

legend.numpointsint = 1

the number of marker points in the legend line

legend.scatterpointsint = 1

number of scatter points

legend.markerscalefloat = 1.0

the relative size of legend markers vs. original

legend.fontsize_FontSizeType = 'medium'

The font size of legend text.

legend.labelcolorcolor or {"linecolor", "markerfacecolor", "markeredgecolor"} = 'None'

The color of the labels in legend entries. The special values 'linecolor', 'markerfacecolor', and 'markeredgecolor' infer the color from the associated legend handle; i.e. using 'linecolor' will render the label of a red line also in red.

legend.title_fontsize_FontSizeType | None = None

None sets to the same as the default axes.

legend.borderpadfloat = 0.4

border whitespace

legend.labelspacingfloat = 0.5

the vertical space between the legend entries

legend.handlelengthfloat = 2.0

the length of the legend lines

legend.handleheightfloat = 0.7

the height of the legend handle

legend.handletextpadfloat = 0.8

the space between the legend line and legend text

legend.borderaxespadfloat = 0.5

the border between the axes and legend edge

legend.columnspacingfloat = 2.0

column separation

Figure#

figure.titlesize_FontSizeType = 'large'

size of the figure title (Figure.suptitle())

figure.titleweight_FontWeightType = 'normal'

weight of the figure title

figure.labelsize_FontSizeType = 'large'

size of the figure label (Figure.sup[x|y]label())

figure.labelweight_FontWeightType = 'normal'

weight of the figure label

figure.figsizetuple[float, float] = [6.4, 4.8]

figure size in inches

figure.dpifloat = 100.0

figure dots per inch

figure.facecolorcolor = 'white'

figure face color

figure.edgecolorcolor = 'white'

figure edge color

figure.frameonbool = True

enable figure frame

figure.max_open_warningint = 20

The maximum number of figures to open through the pyplot interface before emitting a warning. If less than one this feature is disabled.

figure.raise_windowbool = True

Raise the GUI window to front when show() is called. If set to False, we currently do not take any further actions and whether the window appears on the front may depend on the GUI framework and window manager.

figure.subplot.leftfloat = 0.125

the left side of the subplots of the figure

figure.subplot.rightfloat = 0.9

the right side of the subplots of the figure

figure.subplot.bottomfloat = 0.11

the bottom of the subplots of the figure

figure.subplot.topfloat = 0.88

the top of the subplots of the figure

figure.subplot.wspacefloat = 0.2

the amount of width reserved for space between subplots, expressed as a fraction of the average axis width

figure.subplot.hspacefloat = 0.2

the amount of height reserved for space between subplots, expressed as a fraction of the average axis height

figure.autolayoutbool = False

When True, automatically adjust subplot parameters to make the plot fit the figure using tight_layout

figure.constrained_layout.usebool = False

When True, automatically make plot elements fit on the figure. (Not compatible with "figure.autolayout", above).

figure.constrained_layout.h_padfloat = 0.04167

Padding (in inches) around axes; defaults to 3/72 inches, i.e. 3 points

figure.constrained_layout.w_padfloat = 0.04167

Padding (in inches) around axes; defaults to 3/72 inches, i.e. 3 points

figure.constrained_layout.hspacefloat = 0.02

Spacing between subplots, relative to the subplot sizes. Much smaller than for tight_layout (figure.subplot.hspace, figure.subplot.wspace) as constrained_layout already takes surrounding texts (titles, labels, # ticklabels) into account.

figure.constrained_layout.wspacefloat = 0.02

Spacing between subplots, relative to the subplot sizes. Much smaller than for tight_layout (figure.subplot.hspace, figure.subplot.wspace) as constrained_layout already takes surrounding texts (titles, labels, # ticklabels) into account.

Images#

image.aspecttyping.Union[typing.Literal['equal', 'auto'], float] = 'equal'

The default image aspect ratio.

image.interpolationstr = 'auto'

The default interpolation method for images; see imshow for details.

image.interpolation_stage'auto' | 'data' | 'rgba' = 'auto'

The stage at which image interpolation is applied; see imshow for details.

image.cmapstr or Colormap = 'viridis'

The default colormap.

image.lutint = 256

The default size of the colormap lookup table. For each colormap, this is determined at creation time.

image.origin'upper' | 'lower' = 'upper'

The default image origin.

image.resamplebool = True

Whether to resample images when drawing.

image.composite_imagebool = True

When True, all the images on a set of axes are combined into a single composite image before saving a figure as a vector graphics file, such as a PDF.

Contour plots#

Default settings for contour / contourf. See the description of its parameters for details.

contour.negative_linestyle_LineStyleType = 'dashed'

The line style for negative contours, if linestyle is None and no color is specified.

contour.corner_maskbool = True

Enable/disable corner masking. See the corner_mask parameter of contour for details.

contour.linewidthfloat | None = None

Size of the contour line widths. If None, falls back to "lines.linewidth".

contour.algorithm'mpl2005' | 'mpl2014' | 'serial' | 'threaded' = 'mpl2014'

The contouring algorithm used to calculate the contour lines.

Errorbar plots#

errorbar.capsizefloat = 0.0

The length of error bar caps, in pixels.

errorbar.capthickfloat | None = None

The thickness of error bar caps, in points.

errorbar.elinewidthfloat | None = None

The line width of the error bar lines, in points.

Histogram plots#

hist.binstyping.Union[int, list[float], typing.Literal['auto', 'sturges', 'fd', 'doane', 'scott', 'rice', 'sqrt']] = 10

The default histogram bins. An integer specifies a fixed number of bins; a list of floats specifies the bin edges; the strings define binning strategies. See also the bins parameter in hist.

Scatter plots#

scatter.markerstr | int = 'o'

The default marker type for scatter plots.

scatter.edgecolorsstr = 'face'

The default edge color behavior for scatter plots.

AGG rendering#

agg.path.chunksizeint = 0

0 to disable; values in the range 10000 to 100000 can improve speed slightly and prevent an Agg rendering failure when plotting very large data sets, especially if they are very gappy. It may cause minor artifacts, though. A value of 20000 is probably a good starting point.

Paths#

path.simplifybool = True

When True, simplify paths by removing "invisible" points to reduce file size and increase rendering speed

path.simplify_thresholdfloat = 0.111111111111

The threshold of similarity below which vertices will be removed in the simplification process.

path.snapbool = True

When True, rectilinear axis-aligned paths will be snapped to the nearest pixel when certain criteria are met. When False, paths will never be snapped.

path.sketchtuple[float, float, float] | None = None

May be None, or a tuple of the form:path.sketch: (scale, length, randomness)- scale is the amplitude of the wiggle perpendicular to the line (in pixels).- length is the length of the wiggle along the line (in pixels).- randomness is the factor by which the length is randomly scaled.

path.effectslist = []

no description

Saving figures#

savefig.dpityping.Union[typing.Literal['figure'], float] = 'figure'

The output figure DPI, or 'figure' to use the figure DPI.

savefig.facecolorcolor or "auto" = 'auto'

The figure face color when saving.

savefig.edgecolorcolor or "auto" = 'auto'

The figure edge color when saving.

savefig.formatstr = 'png'

Fallback file format for`~.Figure.savefig` if no format is set explicitly and it also couldn't be inferred from the file extension. Valid values are the values that the format parameter of savefig accepts.

savefig.bboxtyping.Optional[typing.Literal['tight', 'standard']] = None

Whether to use a tight bounding box or the standard figure box;tight is incompatible with animation frames.

savefig.pad_inchesfloat = 0.1

The padding to use when 'savefig.bbox' is set to 'tight'.

savefig.directorystr = '~'

default directory in savefig dialog, gets updated after interactive saves, unless set to the empty string (i.e. the current directory); use '.' to start at the current directory but update after interactive saves

savefig.transparentbool = False

Whether figures are saved with a transparent background.

savefig.orientation'landscape' | 'portrait' = 'portrait'

The page orientation for saved figures, for PostScript output only.

Mac OSX backend parameters#

macosx.window_mode'system' | 'tab' | 'window' = 'system'

How to open new figures: 'system', 'tab', or 'window'; 'system' uses the macOS system preferences.

Tk backend parameters#

tk.window_focusbool = False

Whether TkAgg should keep shell focus after opening a figure.

PS backend parameters#

ps.papersize'figure' | 'letter' | 'legal' | 'ledger' | 'A0' | 'A1' | 'A2' | 'A3' | 'A4' | 'A5' | 'A6' | 'A7' | 'A8' | 'A9' | 'A10' | 'B0' | 'B1' | 'B2' | 'B3' | 'B4' | 'B5' | 'B6' | 'B7' | 'B8' | 'B9' | 'B10' = 'letter'

The default PostScript paper size.

ps.useafmbool = False

Whether to use AFM fonts, which typically produces smaller files.

ps.usedistillertyping.Optional[typing.Literal['ghostscript', 'xpdf']] = None

{ghostscript, xpdf, None} Experimental: may produce smaller files. xpdf intended for production of publication quality files, but requires ghostscript, xpdf and ps2eps

ps.distiller.resint = 6000

The resolution, in DPI, used by the PostScript distiller.

ps.fonttype3 | 42 = 3

Output Type 3 (Type3) or Type 42 (TrueType)

PDF backend parameters#

pdf.compressionint = 6

The PDF compression level between 0 (compression disabled) and 9 (maximal compression).

pdf.fonttype3 | 42 = 3

Output Type 3 (Type3) or Type 42 (TrueType)

pdf.use14corefontsbool = False

Whether to only use the Base 14 fonts defined by the PDF specification. If False, fonts are embedded into the PDF.

pdf.inheritcolorbool = False

no description

SVG backend parameters#

svg.image_inlinebool = True

Whether to write raster image data directly into the SVG file.

svg.fonttype'none' | 'path' = 'path'

How to handle SVG fonts: 'path' embeds characters as paths and is supported by most SVG renderers; 'none' assumes the fonts are installed on the machine where the SVG is viewed.

svg.hashsaltstr | None = None

If not None, use this string as the hash salt instead of uuid4.

svg.idstr | None = None

If not None, use this string as the value for the id attribute in the top <svg> tag.

PGF parameters#

pgf.rcfontsbool = True

Whether to copy font settings from rcParams into PGF output.

pgf.preamblestr = ''

See 'text.latex.preamble' for documentation.

pgf.texsystem'xelatex' | 'lualatex' | 'pdflatex' = 'xelatex'

The TeX engine to use for PGF output.

Docstring parameters#

docstring.hardcopybool = False

Whether to generate hardcopy docstrings.

Interactive keymaps#

Default key mappings for interactive navigation. See Navigation keyboard shortcuts.

keymap.fullscreenlist[str] = ['f', 'ctrl+f']

The keyboard shortcuts for toggling fullscreen mode.

keymap.homelist[str] = ['h', 'r', 'home']

The keyboard shortcuts for resetting the view.

keymap.backlist[str] = ['left', 'c', 'backspace', 'MouseButton.BACK']

The keyboard shortcuts for moving backward in the view history.

keymap.forwardlist[str] = ['right', 'v', 'MouseButton.FORWARD']

The keyboard shortcuts for moving forward in the view history.

keymap.panlist[str] = ['p']

The keyboard shortcuts for panning the view.

keymap.zoomlist[str] = ['o']

The keyboard shortcuts for zooming the view.

keymap.savelist[str] = ['s', 'ctrl+s']

The keyboard shortcuts for saving the current figure.

keymap.helplist[str] = ['f1']

The keyboard shortcuts for showing help about active tools.

keymap.quitlist[str] = ['ctrl+w', 'cmd+w', 'q']

The keyboard shortcuts for closing the current figure.

keymap.quit_alllist[str] = []

The keyboard shortcuts for closing all figures.

keymap.gridlist[str] = ['g']

The keyboard shortcuts for toggling the major grid in the current axes.

keymap.grid_minorlist[str] = ['G']

The keyboard shortcuts for toggling the minor grid in the current axes.

keymap.yscalelist[str] = ['l']

The keyboard shortcuts for toggling the y-axis scale between log and linear.

keymap.xscalelist[str] = ['k', 'L']

The keyboard shortcuts for toggling the x-axis scale between log and linear.

keymap.copylist[str] = ['ctrl+c', 'cmd+c']

The keyboard shortcuts for copying the figure to the clipboard.

Animation#

animation.html'html5' | 'jshtml' | 'none' = 'none'

How to display animations as HTML in IPython notebooks: 'html5' uses the HTML5 video tag, 'jshtml' creates a JavaScript animation, and 'none' disables HTML output.

animation.writerstr = 'ffmpeg'

The MovieWriter backend.

animation.codecstr = 'h264'

The codec for writing movies.

animation.bitrateint = -1

The animation bitrate; -1 lets the utility choose automatically.

animation.frame_format'png' | 'jpeg' | 'tiff' | 'raw' | 'rgba' | 'ppm' | 'sgi' | 'bmp' | 'pbm' | 'svg' = 'png'

The file format of temporary files for rendering animation frames.

animation.ffmpeg_pathstr = 'ffmpeg'

Path to ffmpeg binary. Unqualified paths are resolved by subprocess.Popen.

animation.ffmpeg_argslist[str] = []

Additional arguments to pass to ffmpeg.

animation.convert_pathstr = 'convert'

Path to ImageMagick's convert binary. Unqualified paths are resolved by subprocess.Popen, except that on Windows, we look up an install of ImageMagick in the registry (as convert is also the name of a system tool).

animation.convert_argslist[str] = ['-layers', 'OptimizePlus']

Additional arguments to pass to convert.

animation.embed_limitfloat = 20.0

The maximum Base64-encoded animation size, in MB, for HTML output such as IPython notebooks.

backend= None

no description

Gallery generated by Sphinx-Gallery