| [ Web Proxy ] |
| Viewing: https://matplotlib.org/devdocs/api/../users/explain/text/../text/../figure/../configuration.html | [Back] [Original] |
Note
Go to the end to download the full example code.
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.
'large'size of the figure title (Figure.suptitle())
'normal'weight of the figure title
'large'size of the figure label (Figure.sup[x|y]label())
'normal'weight of the figure label
[6.4, 4.8]figure size in inches
100.0figure dots per inch
'white'figure face color
'white'figure edge color
Trueenable figure frame
20The maximum number of figures to open through the pyplot interface before emitting a warning. If less than one this feature is disabled.
TrueRaise 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.
0.125the left side of the subplots of the figure
0.9the right side of the subplots of the figure
0.11the bottom of the subplots of the figure
0.88the top of the subplots of the figure
0.2the amount of width reserved for space between subplots, expressed as a fraction of the average axis width
0.2the amount of height reserved for space between subplots, expressed as a fraction of the average axis height
FalseWhen True, automatically adjust subplot parameters to make the plot fit the figure using tight_layout
FalseWhen True, automatically make plot elements fit on the figure. (Not compatible with "figure.autolayout", above).
0.04167Padding (in inches) around axes; defaults to 3/72 inches, i.e. 3 points
0.04167Padding (in inches) around axes; defaults to 3/72 inches, i.e. 3 points
0.02Spacing 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.
0.02Spacing 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.
[]list of dotted.module.name:dotted.callable.name
'white'The axes background color.
'black'The axes edge color.
0.8The axes edge line width.
FalseWhether to display the grid.
'both'Which axis the grid should apply to.
'major'Whether to draw grid lines at major ticks, minor ticks, or both.
'center'The alignment of the axes title.
'large'The font size of the axes title.
'normal'The font weight of the axes title.
'auto'The color of the axes title; auto falls back to 'text.color'.
NoneThe vertical title position in axes coordinates; None enables automatic placement.
6.0The padding between the axes and title, in points.
'medium'The font size of the x and y labels.
4.0The space between the axis label and the axis, in points.
'normal'The font weight of the x and y labels.
'black'The color of the axis labels.
'line'draw axis gridlines and ticks: - below patches (True) - above patches but below lines ('line') - above all (False)
[-5, 6]use scientific notation if log10 of the axis range is smaller than the first or larger than the second
FalseWhen True, format tick labels according to the user's locale. For example, use ',' as a decimal separator in the fr_FR locale.
FalseWhen True, use mathtext for scientific notation.
0minimum exponent to format in scientific notation
TrueIf 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.
4When useoffset is True, the offset will be used when it can remove at least this number of significant digits from tick labels.
Truedisplay axis spines
TrueWhether to draw the bottom axis spine.
TrueWhether to draw the top axis spine.
TrueWhether to draw the right axis spine.
Trueuse Unicode for the minus symbol rather than hyphen. See https://en.wikipedia.org/wiki/Plus_and_minus_signs#Character_codes
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.
0.05x margin. See margins
0.05y margin. See margins
0.05z margin. See margins
'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.
Truedisplay grid on polar axes
Truedisplay grid on 3D axes
Falseautomatically add margin when manually setting 3D axis limits
(0.95, 0.95, 0.95, 0.5)background pane on 3D axes
(0.9, 0.9, 0.9, 0.5)background pane on 3D axes
(0.925, 0.925, 0.925, 0.5)background pane on 3D axes
Truedepth shade for 3D scatter plots
0.3minimum alpha value for depth shading
'arcball'The way mouse movements are interpreted as 3D rotations. See also Rotation with mouse.
0.667trackball diameter, in units of the Axes bbox
0.2trackball border width, in units of the Axes bbox (only for 'sphere' and 'arcball' style)
5.0Snap angle (in degrees) for 3D rotation when holding Control.
'center'Horizontal location of the x-axis label.
'center'Vertical location of the y-axis label.
Default properties for date tick labels. These are used by the AutoDateFormatter when the appropriate time unit is detected. See Matplotlib date format for more information.
'%Y'The strftime format for year ticks.
'%Y-%m'The strftime format for month ticks.
'%Y-%m-%d'The strftime format for day ticks.
'%m-%d %H'The strftime format for hour ticks.
'%d %H:%M'The strftime format for minute ticks.
'%H:%M:%S'The strftime format for second ticks.
'%M:%S.%f'The strftime format for microsecond ticks.
'1970-01-01T00:00:00'The reference date for Matplotlib's internal date representation. See Date precision and epochs.
'auto'The date converter to use.
TrueWhether the automatic date converter should use interval_multiples.
FalseWhether to draw tick lines at the top of the Axes.
TrueWhether to draw tick lines at the bottom of the Axes.
FalseWhether to draw tick labels at the top of the Axes.
TrueWhether to draw tick labels at the bottom of the Axes.
3.5Length of the major tick lines in points.
2.0Length of the minor tick lines in points.
0.8Width of the major tick lines in points.
0.6Width of the minor tick lines in points.
3.5Spacing between tick line and tick label of major ticks in points.
3.4Spacing between tick line and tick label of minor ticks in points.
'black'Color of the ticks lines.
'inherit'Color of the tick labels. 'inherit' uses the line color of the tick lines, see 'xtick.color'.
'medium'Font size of the tick labels.
'out'Direction of the tick lines.
FalseWhether to draw minor ticks on the x-axis.
TrueWhether to draw major ticks at the top of the Axes.
TrueWhether to draw major ticks at the bottom of the Axes.
TrueWhether to draw minor ticks at the top of the Axes.
TrueWhether to draw minor ticks at the bottom of the Axes.
'auto'Default number of minor ticks in between major ticks, used by the AutoMinorLocator.
'center'Horizontal alignment of tick labels relative to the tick lines.
TrueWhether to draw tick lines at the left of the Axes.
FalseWhether to draw tick lines at the right of the Axes.
TrueWhether to draw tick labels at the left of the Axes.
FalseWhether to draw tick labels at the right of the Axes.
3.5Length of the major tick lines in points.
2.0Length of the minor tick lines in points.
0.8Width of the major tick lines in points.
0.6Width of the minor tick lines in points.
3.5Spacing between tick line and tick label of major ticks in points.
3.4Spacing between tick line and tick label of minor ticks in points.
'black'Color of the tick lines.
'inherit'Color of the tick labels. 'inherit' uses the line color of the tick lines, see 'ytick.color'.
'medium'Font size of the tick labels.
'out'Direction of the tick lines.
FalseWhether to draw minor ticks on the y-axis.
TrueWhether to draw major ticks at the left of the Axes.
TrueWhether to draw major ticks at the right of the Axes.
TrueWhether to draw minor ticks at the left of the Axes.
TrueWhether to draw minor ticks at the right of the Axes.
'auto'Default number of minor ticks in between major ticks, used by the AutoMinorLocator.
'center_baseline'Vertical alignment of tick labels relative to the tick lines.
'#b0b0b0'The default grid line color.
'-'The default grid line style.
0.8The default grid line width, in points.
1.0The default grid line transparency, between 0.0 (fully transparent) and 1.0 (opaque).
NoneIf None defaults to grid.color
NoneIf None defaults to grid.linestyle
NoneIf None defaults to grid.linewidth
NoneIf None defaults to grid.alpha
NoneIf None defaults to grid.color
NoneIf None defaults to grid.linestyle
NoneIf None defaults to grid.linewidth
NoneIf None defaults to grid.alpha
'best'The legend location. See the loc parameter in Axes.legend.
Trueif True, draw the legend on a background patch
0.8legend patch transparency
'inherit'inherit from axes.facecolor; or color spec
'0.8'background patch boundary color
Noneline width of the legend frame, None means inherit from patch.linewidth
Trueif True, use a rounded box for the legend background, else a rectangle
Falseif True, give background a shadow effect
1the number of marker points in the legend line
1number of scatter points
1.0the relative size of legend markers vs. original
'medium'The font size of legend text.
'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.
NoneNone sets to the same as the default axes.
0.4border whitespace
0.5the vertical space between the legend entries
2.0the length of the legend lines
0.7the height of the legend handle
0.8the space between the legend line and legend text
0.5the border between the axes and legend edge
2.0column separation
Default line properties. Some plotting functions such as plot may override them with information from the property cycle; see Styling with cycler.
1.5The default line width in points.
'-'The default line style.
'C0'The default line color.
'None'The default marker type.
'auto'The default marker face color; use 'auto' to use 'lines.color'.
'auto'The default marker edge color; use 'auto' to use 'lines.color'.
1.0The default width of the marker edge stroke, in points.
6.0The default marker size, in points.
'round'The join style used where dashed line segments meet.
'butt'The cap style used at the ends of dashed line segments.
'round'The join style used where solid line segments meet.
'projecting'The cap style used at the ends of solid lines.
TrueWhether to render lines with antialiasing.
[3.7, 1.6]The dash pattern for linestyle 'dashed'.
[6.4, 1.6, 1.0, 1.6]The dash pattern for linestyle 'dashdot'.
[1.0, 1.65]The dash pattern for linestyle 'dotted'.
TrueWhether dash lengths are scaled by the line width.
'full'The marker fill style.
1.0The patch edge width, in points.
'C0'The patch face color.
'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.
FalseBy 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.
TrueWhether to render patches with antialiasing.
TrueWhen True, simplify paths by removing "invisible" points to reduce file size and increase rendering speed
0.111111111111The threshold of similarity below which vertices will be removed in the simplification process.
TrueWhen True, rectilinear axis-aligned paths will be snapped to the nearest pixel when certain criteria are met. When False, paths will never be snapped.
NoneMay 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.
[]no description
'edge'The color of hatch strokes.
1.0The width of hatch strokes, in points.
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.
['sans-serif']A prioritized list of font families to try.
'normal'The default font style.
'normal'The default font variant.
'normal'The default font weight.
'normal'The default font stretch.
10.0The default font size, in points.
['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.
['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.
['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.
['Chicago', 'Charcoal', 'Impact', 'Western', 'xkcd script', 'fantasy']Fonts to be used for the generic "fantasy" font family specifier, in descending priority.
['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.
TrueIf 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.
'black'The default text color.
NoneThe 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.
'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.)
None[DEPRECATED] This setting has no effect.
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.
TrueIf True (default), the text will be antialiased. This only affects raster outputs.
TrueUse mathtext if there is an even number of unescaped dollar signs.
Falseuse 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
'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.
''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.
'dejavusans'Should be 'dejavusans' (default), 'dejavuserif', 'cm' (Computer Modern), 'stix', 'stixsans' or 'custom'
'sans:bold'The font config pattern for bold math text.
'sans:italic:bold'The font config pattern for bold italic math text.
'cursive'The font config pattern for calligraphic math text.
'sans:italic'The font config pattern for italic math text.
'sans'The font config pattern for roman math text.
'sans'The font config pattern for sans-serif math text.
'monospace'The font config pattern for monospace math text.
'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.
'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.
'equal'The default image aspect ratio.
'auto'The default interpolation method for images; see imshow for details.
'auto'The stage at which image interpolation is applied; see imshow for details.
'viridis'The default colormap.
256The default size of the colormap lookup table. For each colormap, this is determined at creation time.
'upper'The default image origin.
TrueWhether to resample images when drawing.
TrueWhen 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.
'auto'The default shading mode for pcolor and pcolormesh.
TrueWhether 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.
Default settings for contour / contourf. See the description of its parameters for details.
'dashed'The line style for negative contours, if linestyle is None and no color is specified.
TrueEnable/disable corner masking. See the corner_mask parameter of contour for details.
NoneSize of the contour line widths. If None, falls back to "lines.linewidth".
'mpl2014'The contouring algorithm used to calculate the contour lines.
0.0The length of error bar caps, in pixels.
NoneThe thickness of error bar caps, in points.
NoneThe line width of the error bar lines, in points.
10The 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.
FalseWhether to draw notches around the median.
TrueWhether to draw vertical boxplots.
1.5The whisker length as a multiple of the interquartile range, or a (lower, upper) pair.
NoneThe number of bootstrap resamples used to estimate boxplot notches; None disables bootstrapping.
FalseWhether boxplots should be drawn as patches instead of line artists.
FalseWhether to draw the mean on boxplots.
TrueWhether to draw caps on the whiskers.
TrueWhether to draw the box around the quartiles.
TrueWhether to draw flier markers for outliers.
FalseWhether to draw the mean as a line instead of a marker.
'black'The color of the flier markers.
'o'The marker style of flier markers.
'none'The face color of flier markers.
'black'The edge color of flier markers.
1.0The width of the flier marker edge, in points.
6.0The flier marker size, in points.
'none'The line style of flier markers.
1.0The line width of flier markers, in points.
'black'The box outline color.
1.0The box outline width, in points.
'-'The box outline style.
'black'The whisker line color.
1.0The whisker line width, in points.
'-'The whisker line style.
'black'The cap line color.
1.0The cap line width, in points.
'-'The cap line style.
'C1'The median line color.
1.0The median line width, in points.
'-'The median line style.
'C2'The mean marker or line color.
'^'The marker style of the mean marker.
'C2'The face color of the mean marker.
'C2'The edge color of the mean marker.
6.0The mean marker size, in points.
'--'The line style of the mean marker or line.
1.0The line width of the mean marker or line, in points.
'o'The default marker type for scatter plots.
'face'The default edge color behavior for scatter plots.
'figure'The output figure DPI, or 'figure' to use the figure DPI.
'auto'The figure face color when saving.
'auto'The figure edge color when saving.
'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.
NoneWhether to use a tight bounding box or the standard figure box;tight is incompatible with animation frames.
0.1The padding to use when 'savefig.bbox' is set to 'tight'.
'~'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
FalseWhether figures are saved with a transparent background.
'portrait'The page orientation for saved figures, for PostScript output only.
Noneno description
TrueIf 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
Falseno description
'toolbar2'{None, toolbar2, toolmanager}
00 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.
'system'How to open new figures: 'system', 'tab', or 'window'; 'system' uses the macOS system preferences.
FalseWhether TkAgg should keep shell focus after opening a figure.
'letter'The default PostScript paper size.
FalseWhether to use AFM fonts, which typically produces smaller files.
None{ghostscript, xpdf, None} Experimental: may produce smaller files. xpdf intended for production of publication quality files, but requires ghostscript, xpdf and ps2eps
6000The resolution, in DPI, used by the PostScript distiller.
3Output Type 3 (Type3) or Type 42 (TrueType)
6The PDF compression level between 0 (compression disabled) and 9 (maximal compression).
3Output Type 3 (Type3) or Type 42 (TrueType)
FalseWhether to only use the Base 14 fonts defined by the PDF specification. If False, fonts are embedded into the PDF.
Falseno description
TrueWhether to write raster image data directly into the SVG file.
'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.
NoneIf not None, use this string as the hash salt instead of uuid4.
NoneIf not None, use this string as the value for the id attribute in the top <svg> tag.
TrueWhether to copy font settings from rcParams into PGF output.
''See 'text.latex.preamble' for documentation.
'xelatex'The TeX engine to use for PGF output.
8988The server port in the WebAgg backend.
'127.0.0.1'The server address in the WebAgg backend.
50If webagg.port is unavailable, a number of other random ports will be tried until one that is available is found.
TrueWhen True, open the web browser to the plot that is shown.
Default key mappings for interactive navigation. See Navigation keyboard shortcuts.
['f', 'ctrl+f']The keyboard shortcuts for toggling fullscreen mode.
['h', 'r', 'home']The keyboard shortcuts for resetting the view.
['left', 'c', 'backspace', 'MouseButton.BACK']The keyboard shortcuts for moving backward in the view history.
['right', 'v', 'MouseButton.FORWARD']The keyboard shortcuts for moving forward in the view history.
['p']The keyboard shortcuts for panning the view.
['o']The keyboard shortcuts for zooming the view.
['s', 'ctrl+s']The keyboard shortcuts for saving the current figure.
['f1']The keyboard shortcuts for showing help about active tools.
['ctrl+w', 'cmd+w', 'q']The keyboard shortcuts for closing the current figure.
[]The keyboard shortcuts for closing all figures.
['g']The keyboard shortcuts for toggling the major grid in the current axes.
['G']The keyboard shortcuts for toggling the minor grid in the current axes.
['l']The keyboard shortcuts for toggling the y-axis scale between log and linear.
['k', 'L']The keyboard shortcuts for toggling the x-axis scale between log and linear.
['ctrl+c', 'cmd+c']The keyboard shortcuts for copying the figure to the clipboard.
'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.
'ffmpeg'The MovieWriter backend.
'h264'The codec for writing movies.
-1The animation bitrate; -1 lets the utility choose automatically.
'png'The file format of temporary files for rendering animation frames.
'ffmpeg'Path to ffmpeg binary. Unqualified paths are resolved by subprocess.Popen.
[]Additional arguments to pass to ffmpeg.
'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).
['-layers', 'OptimizePlus']Additional arguments to pass to convert.
20.0The maximum Base64-encoded animation size, in MB, for HTML output such as IPython notebooks.
FalseWhether to generate hardcopy docstrings.
'UTC'a pytz timezone string, e.g., US/Central or Europe/Paris
| Web Proxy Viewer | New URL | Original Page |