From 239598a4ab38c4de76d5a59ab0c800bbeb2d57db Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Thu, 8 Jun 2023 01:41:28 +0200 Subject: [PATCH 1/3] Define the supported rcParams as code Until now, the parameter definition was dispersed: valid names and defaults are loaded from the canonical `matplotlibrc` data file. Docs are only available as comments in there. Validators are attached ad-hoc in `rcsetup.py`. This makes for a more formal definition of parameters, including meta-information, like validators, docs in a single place. It will simplify the rcParams related code in `matplotlib.__init__.py` and `matplotlib.rcsetup.py`. It also enables us to generate sphinx documentation on the parameters. --- doc/users/_rcparams_generated.rst | 1006 ++++++++++++ doc/users/index.rst | 1 + galleries/users_explain/configuration.py | 14 + lib/matplotlib/rcsetup.py | 1890 +++++++++++++++++++++- lib/matplotlib/rcsetup.pyi | 1 + lib/matplotlib/sphinxext/roles.py | 19 +- lib/matplotlib/tests/test_rcparams.py | 19 + 7 files changed, 2947 insertions(+), 3 deletions(-) create mode 100644 doc/users/_rcparams_generated.rst create mode 100644 galleries/users_explain/configuration.py diff --git a/doc/users/_rcparams_generated.rst b/doc/users/_rcparams_generated.rst new file mode 100644 index 000000000000..42a8575413bf --- /dev/null +++ b/doc/users/_rcparams_generated.rst @@ -0,0 +1,1006 @@ +.. + autogenerated rcParams documentation. Update via + > python -c "from matplotlib import rcsetup; rcsetup._write_rcParam_rst()" + + +webagg.port: ``8988`` + The port to use for the web server in the WebAgg backend. + +webagg.address: ``'127.0.0.1'`` + The address on which the WebAgg web server should be reachable. + +webagg.port_retries: ``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_browser: ``True`` + When True, open the web browser to the plot that is shown + +backend_fallback: ``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 + +interactive: ``False`` + *no description* + +figure.hooks: ``[]`` + list of dotted.module.name:dotted.callable.name + +toolbar: ``'toolbar2'`` + {None, toolbar2, toolmanager} + +timezone: ``'UTC'`` + a pytz timezone string, e.g., US/Central or Europe/Paris + +lines.linewidth: ``1.5`` + line width in points + +lines.linestyle: ``'-'`` + solid line + +lines.color: ``'C0'`` + has no affect on plot(); see axes.prop_cycle + +lines.marker: ``'None'`` + the default marker + +lines.markerfacecolor: ``'auto'`` + the default marker face color + +lines.markeredgecolor: ``'auto'`` + the default marker edge color + +lines.markeredgewidth: ``1.0`` + the line width around the marker symbol + +lines.markersize: ``6.0`` + marker size, in points + +lines.dash_joinstyle: ``'round'`` + {miter, round, bevel} + +lines.dash_capstyle: ``'butt'`` + {butt, round, projecting} + +lines.solid_joinstyle: ``'round'`` + {miter, round, bevel} + +lines.solid_capstyle: ``'projecting'`` + {butt, round, projecting} + +lines.antialiased: ``True`` + render lines in antialiased (no jaggies) + +lines.dashed_pattern: ``[3.7, 1.6]`` + The dash pattern for linestyle 'dashed' + +lines.dashdot_pattern: ``[6.4, 1.6, 1.0, 1.6]`` + The dash pattern for linestyle 'dashdot' + +lines.dotted_pattern: ``[1.0, 1.65]`` + The dash pattern for linestyle 'dotted' + +lines.scale_dashes: ``True`` + *no description* + +markers.fillstyle: ``'full'`` + {full, left, right, bottom, top, none} + +pcolor.shading: ``'auto'`` + *no description* + +pcolormesh.snap: ``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. + +patch.linewidth: ``1.0`` + edge width in points. + +patch.facecolor: ``'C0'`` + *no description* + +patch.edgecolor: ``'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_edgecolor: ``False`` + By default, Patches and Collections do not draw edges. Set this to True to draw edges with patch.edgedcolor as the default edgecolor. This is mainly relevant for styles. + +patch.antialiased: ``True`` + render patches in antialiased (no jaggies) + +hatch.color: ``'edge'`` + *no description* + +hatch.linewidth: ``1.0`` + *no description* + +boxplot.notch: ``False`` + *no description* + +boxplot.vertical: ``True`` + *no description* + +boxplot.whiskers: ``1.5`` + *no description* + +boxplot.bootstrap: ``None`` + *no description* + +boxplot.patchartist: ``False`` + *no description* + +boxplot.showmeans: ``False`` + *no description* + +boxplot.showcaps: ``True`` + *no description* + +boxplot.showbox: ``True`` + *no description* + +boxplot.showfliers: ``True`` + *no description* + +boxplot.meanline: ``False`` + *no description* + +boxplot.flierprops.color: ``'black'`` + *no description* + +boxplot.flierprops.marker: ``'o'`` + *no description* + +boxplot.flierprops.markerfacecolor: ``'none'`` + *no description* + +boxplot.flierprops.markeredgecolor: ``'black'`` + *no description* + +boxplot.flierprops.markeredgewidth: ``1.0`` + *no description* + +boxplot.flierprops.markersize: ``6.0`` + *no description* + +boxplot.flierprops.linestyle: ``'none'`` + *no description* + +boxplot.flierprops.linewidth: ``1.0`` + *no description* + +boxplot.boxprops.color: ``'black'`` + *no description* + +boxplot.boxprops.linewidth: ``1.0`` + *no description* + +boxplot.boxprops.linestyle: ``'-'`` + *no description* + +boxplot.whiskerprops.color: ``'black'`` + *no description* + +boxplot.whiskerprops.linewidth: ``1.0`` + *no description* + +boxplot.whiskerprops.linestyle: ``'-'`` + *no description* + +boxplot.capprops.color: ``'black'`` + *no description* + +boxplot.capprops.linewidth: ``1.0`` + *no description* + +boxplot.capprops.linestyle: ``'-'`` + *no description* + +boxplot.medianprops.color: ``'C1'`` + *no description* + +boxplot.medianprops.linewidth: ``1.0`` + *no description* + +boxplot.medianprops.linestyle: ``'-'`` + *no description* + +boxplot.meanprops.color: ``'C2'`` + *no description* + +boxplot.meanprops.marker: ``'^'`` + *no description* + +boxplot.meanprops.markerfacecolor: ``'C2'`` + *no description* + +boxplot.meanprops.markeredgecolor: ``'C2'`` + *no description* + +boxplot.meanprops.markersize: ``6.0`` + *no description* + +boxplot.meanprops.linestyle: ``'--'`` + *no description* + +boxplot.meanprops.linewidth: ``1.0`` + *no description* + +font.family: ``['sans-serif']`` + *no description* + +font.style: ``'normal'`` + *no description* + +font.variant: ``'normal'`` + *no description* + +font.weight: ``'normal'`` + *no description* + +font.stretch: ``'normal'`` + *no description* + +font.size: ``10.0`` + *no description* + +font.serif: ``['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']`` + *no description* + +font.sans-serif: ``['DejaVu Sans', 'Bitstream Vera Sans', 'Computer Modern Sans Serif', 'Lucida Grande', 'Verdana', 'Geneva', 'Lucid', 'Arial', 'Helvetica', 'Avant Garde', 'sans-serif']`` + *no description* + +font.cursive: ``['Apple Chancery', 'Textile', 'Zapf Chancery', 'Sand', 'Script MT', 'Felipa', 'Comic Neue', 'Comic Sans MS', 'cursive']`` + *no description* + +font.fantasy: ``['Chicago', 'Charcoal', 'Impact', 'Western', 'xkcd script', 'fantasy']`` + *no description* + +font.monospace: ``['DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Computer Modern Typewriter', 'Andale Mono', 'Nimbus Mono L', 'Courier New', 'Courier', 'Fixed', 'Terminal', 'monospace']`` + *no description* + +font.enable_last_resort: ``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.color: ``'black'`` + *no description* + +text.hinting: ``'force_autohint'`` + 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_factor: ``8`` + Specifies the amount of softness for hinting in the horizontal direction. A value of 1 will hint to full pixels. A value of 2 will hint to half pixels etc. + +text.kerning_factor: ``0`` + 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.antialiased: ``True`` + If True (default), the text will be antialiased. This only affects raster outputs. + +text.parse_math: ``True`` + Use mathtext if there is an even number of unescaped dollar signs. + +text.usetex: ``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.preamble: ``''`` + 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'`` + Should be 'dejavusans' (default), 'dejavuserif', 'cm' (Computer Modern), 'stix', 'stixsans' or 'custom' + +mathtext.bf: ``'sans:bold'`` + *no description* + +mathtext.bfit: ``'sans:italic:bold'`` + *no description* + +mathtext.cal: ``'cursive'`` + *no description* + +mathtext.it: ``'sans:italic'`` + *no description* + +mathtext.rm: ``'sans'`` + *no description* + +mathtext.sf: ``'sans'`` + *no description* + +mathtext.tt: ``'monospace'`` + *no description* + +mathtext.fallback: ``'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: ``'it'`` + The default font to use for math. Can be any of the LaTeX font names, including the special name "regular" for the same font used in regular text. + +axes.facecolor: ``'white'`` + axes background color + +axes.edgecolor: ``'black'`` + axes edge color + +axes.linewidth: ``0.8`` + edge line width + +axes.grid: ``False`` + display grid or not + +axes.grid.axis: ``'both'`` + which axis the grid should apply to + +axes.grid.which: ``'major'`` + grid lines at {major, minor, both} ticks + +axes.titlelocation: ``'center'`` + alignment of the title: {left, right, center} + +axes.titlesize: ``'large'`` + font size of the axes title + +axes.titleweight: ``'normal'`` + font weight of title + +axes.titlecolor: ``'auto'`` + color of the axes title, auto falls back to text.color as default value + +axes.titley: ``None`` + position title (axes relative units). None implies auto + +axes.titlepad: ``6.0`` + pad between axes and title in points + +axes.labelsize: ``'medium'`` + font size of the x and y labels + +axes.labelpad: ``4.0`` + space between label and axis + +axes.labelweight: ``'normal'`` + weight of the x and y labels + +axes.labelcolor: ``'black'`` + *no description* + +axes.axisbelow: ``'line'`` + draw axis gridlines and ticks: - below patches (True) - above patches but below lines ('line') - above all (False) + +axes.formatter.limits: ``[-5, 6]`` + use scientific notation if log10 of the axis range is smaller than the first or larger than the second + +axes.formatter.use_locale: ``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_mathtext: ``False`` + When True, use mathtext for scientific notation. + +axes.formatter.min_exponent: ``0`` + minimum exponent to format in scientific notation + +axes.formatter.useoffset: ``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_threshold: ``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.left: ``True`` + display axis spines + +axes.spines.bottom: ``True`` + *no description* + +axes.spines.top: ``True`` + *no description* + +axes.spines.right: ``True`` + *no description* + +axes.unicode_minus: ``True`` + use Unicode for the minus symbol rather than hyphen. See https://en.wikipedia.org/wiki/Plus_and_minus_signs#Character_codes + +axes.prop_cycle: ``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)])`` + *no description* + +axes.xmargin: ``0.05`` + x margin. See `~.axes.Axes.margins` + +axes.ymargin: ``0.05`` + y margin. See `~.axes.Axes.margins` + +axes.zmargin: ``0.05`` + z margin. See `~.axes.Axes.margins` + +axes.autolimit_mode: ``'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. + +polaraxes.grid: ``True`` + display grid on polar axes + +axes3d.grid: ``True`` + display grid on 3D axes + +axes3d.automargin: ``False`` + automatically add margin when manually setting 3D axis limits + +axes3d.xaxis.panecolor: ``(0.95, 0.95, 0.95, 0.5)`` + background pane on 3D axes + +axes3d.yaxis.panecolor: ``(0.9, 0.9, 0.9, 0.5)`` + background pane on 3D axes + +axes3d.zaxis.panecolor: ``(0.925, 0.925, 0.925, 0.5)`` + background pane on 3D axes + +axes3d.depthshade: ``True`` + depth shade for 3D scatter plots + +axes3d.depthshade_minalpha: ``0.3`` + minimum alpha value for depth shading + +axes3d.mouserotationstyle: ``'arcball'`` + {azel, trackball, sphere, arcball} See also https://matplotlib.org/stable/api/toolkits/mplot3d/view_angles.html#rotation-with-mouse + +axes3d.trackballsize: ``0.667`` + trackball diameter, in units of the Axes bbox + +axes3d.trackballborder: ``0.2`` + trackball border width, in units of the Axes bbox (only for 'sphere' and 'arcball' style) + +xaxis.labellocation: ``'center'`` + alignment of the xaxis label: {left, right, center} + +yaxis.labellocation: ``'center'`` + alignment of the yaxis label: {bottom, top, center} + +date.autoformatter.year: ``'%Y'`` + *no description* + +date.autoformatter.month: ``'%Y-%m'`` + *no description* + +date.autoformatter.day: ``'%Y-%m-%d'`` + *no description* + +date.autoformatter.hour: ``'%m-%d %H'`` + *no description* + +date.autoformatter.minute: ``'%d %H:%M'`` + *no description* + +date.autoformatter.second: ``'%H:%M:%S'`` + *no description* + +date.autoformatter.microsecond: ``'%M:%S.%f'`` + *no description* + +date.epoch: ``'1970-01-01T00:00:00'`` + The reference date for Matplotlib's internal date representation. See https://matplotlib.org/stable/gallery/ticks/date_precision_and_epochs.html + +date.converter: ``'auto'`` + 'auto', 'concise' + +date.interval_multiples: ``True`` + For auto converter whether to use interval_multiples + +xtick.top: ``False`` + draw ticks on the top side + +xtick.bottom: ``True`` + draw ticks on the bottom side + +xtick.labeltop: ``False`` + draw label on the top + +xtick.labelbottom: ``True`` + draw label on the bottom + +xtick.major.size: ``3.5`` + major tick size in points + +xtick.minor.size: ``2.0`` + minor tick size in points + +xtick.major.width: ``0.8`` + major tick width in points + +xtick.minor.width: ``0.6`` + minor tick width in points + +xtick.major.pad: ``3.5`` + distance to major tick label in points + +xtick.minor.pad: ``3.4`` + distance to the minor tick label in points + +xtick.color: ``'black'`` + color of the ticks + +xtick.labelcolor: ``'inherit'`` + color of the tick labels or inherit from xtick.color + +xtick.labelsize: ``'medium'`` + font size of the tick labels + +xtick.direction: ``'out'`` + direction: {in, out, inout} + +xtick.minor.visible: ``False`` + visibility of minor ticks on x-axis + +xtick.major.top: ``True`` + draw x axis top major ticks + +xtick.major.bottom: ``True`` + draw x axis bottom major ticks + +xtick.minor.top: ``True`` + draw x axis top minor ticks + +xtick.minor.bottom: ``True`` + draw x axis bottom minor ticks + +xtick.minor.ndivs: ``'auto'`` + number of minor ticks between the major ticks on x-axis + +xtick.alignment: ``'center'`` + alignment of xticks + +ytick.left: ``True`` + draw ticks on the left side + +ytick.right: ``False`` + draw ticks on the right side + +ytick.labelleft: ``True`` + draw tick labels on the left side + +ytick.labelright: ``False`` + draw tick labels on the right side + +ytick.major.size: ``3.5`` + major tick size in points + +ytick.minor.size: ``2.0`` + minor tick size in points + +ytick.major.width: ``0.8`` + major tick width in points + +ytick.minor.width: ``0.6`` + minor tick width in points + +ytick.major.pad: ``3.5`` + distance to major tick label in points + +ytick.minor.pad: ``3.4`` + distance to the minor tick label in points + +ytick.color: ``'black'`` + color of the ticks + +ytick.labelcolor: ``'inherit'`` + color of the tick labels or inherit from ytick.color + +ytick.labelsize: ``'medium'`` + font size of the tick labels + +ytick.direction: ``'out'`` + direction: {in, out, inout} + +ytick.minor.visible: ``False`` + visibility of minor ticks on y-axis + +ytick.major.left: ``True`` + draw y axis left major ticks + +ytick.major.right: ``True`` + draw y axis right major ticks + +ytick.minor.left: ``True`` + draw y axis left minor ticks + +ytick.minor.right: ``True`` + draw y axis right minor ticks + +ytick.minor.ndivs: ``'auto'`` + number of minor ticks between the major ticks on y-axis + +ytick.alignment: ``'center_baseline'`` + alignment of yticks + +grid.color: ``'#b0b0b0'`` + b0b0b0" # grid color + +grid.linestyle: ``'-'`` + solid + +grid.linewidth: ``0.8`` + in points + +grid.alpha: ``1.0`` + transparency, between 0.0 and 1.0 + +grid.major.color: ``None`` + If None defaults to grid.color + +grid.major.linestyle: ``None`` + If None defaults to grid.linestyle + +grid.major.linewidth: ``None`` + If None defaults to grid.linewidth + +grid.major.alpha: ``None`` + If None defaults to grid.alpha + +grid.minor.color: ``None`` + If None defaults to grid.color + +grid.minor.linestyle: ``None`` + If None defaults to grid.linestyle + +grid.minor.linewidth: ``None`` + If None defaults to grid.linewidth + +grid.minor.alpha: ``None`` + If None defaults to grid.alpha + +legend.loc: ``'best'`` + *no description* + +legend.frameon: ``True`` + if True, draw the legend on a background patch + +legend.framealpha: ``0.8`` + legend patch transparency + +legend.facecolor: ``'inherit'`` + inherit from axes.facecolor; or color spec + +legend.edgecolor: ``'0.8'`` + background patch boundary color + +legend.linewidth: ``None`` + line width of the legend frame, None means inherit from patch.linewidth + +legend.fancybox: ``True`` + if True, use a rounded box for the legend background, else a rectangle + +legend.shadow: ``False`` + if True, give background a shadow effect + +legend.numpoints: ``1`` + the number of marker points in the legend line + +legend.scatterpoints: ``1`` + number of scatter points + +legend.markerscale: ``1.0`` + the relative size of legend markers vs. original + +legend.fontsize: ``'medium'`` + *no description* + +legend.labelcolor: ``'None'`` + *no description* + +legend.title_fontsize: ``None`` + None sets to the same as the default axes. + +legend.borderpad: ``0.4`` + border whitespace + +legend.labelspacing: ``0.5`` + the vertical space between the legend entries + +legend.handlelength: ``2.0`` + the length of the legend lines + +legend.handleheight: ``0.7`` + the height of the legend handle + +legend.handletextpad: ``0.8`` + the space between the legend line and legend text + +legend.borderaxespad: ``0.5`` + the border between the axes and legend edge + +legend.columnspacing: ``2.0`` + column separation + +figure.titlesize: ``'large'`` + size of the figure title (``Figure.suptitle()``) + +figure.titleweight: ``'normal'`` + weight of the figure title + +figure.labelsize: ``'large'`` + size of the figure label (``Figure.sup[x|y]label()``) + +figure.labelweight: ``'normal'`` + weight of the figure label + +figure.figsize: ``[6.4, 4.8]`` + figure size in inches + +figure.dpi: ``100.0`` + figure dots per inch + +figure.facecolor: ``'white'`` + figure face color + +figure.edgecolor: ``'white'`` + figure edge color + +figure.frameon: ``True`` + enable figure frame + +figure.max_open_warning: ``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_window: ``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.left: ``0.125`` + the left side of the subplots of the figure + +figure.subplot.right: ``0.9`` + the right side of the subplots of the figure + +figure.subplot.bottom: ``0.11`` + the bottom of the subplots of the figure + +figure.subplot.top: ``0.88`` + the top of the subplots of the figure + +figure.subplot.wspace: ``0.2`` + the amount of width reserved for space between subplots, expressed as a fraction of the average axis width + +figure.subplot.hspace: ``0.2`` + the amount of height reserved for space between subplots, expressed as a fraction of the average axis height + +figure.autolayout: ``False`` + When True, automatically adjust subplot parameters to make the plot fit the figure using `~.Figure.tight_layout` + +figure.constrained_layout.use: ``False`` + When True, automatically make plot elements fit on the figure. (Not compatible with "figure.autolayout", above). + +figure.constrained_layout.h_pad: ``0.04167`` + Padding (in inches) around axes; defaults to 3/72 inches, i.e. 3 points + +figure.constrained_layout.w_pad: ``0.04167`` + Padding (in inches) around axes; defaults to 3/72 inches, i.e. 3 points + +figure.constrained_layout.hspace: ``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.wspace: ``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. + +image.aspect: ``'equal'`` + {equal, auto} or a number + +image.interpolation: ``'auto'`` + see help(imshow) for options + +image.interpolation_stage: ``'auto'`` + see help(imshow) for options + +image.cmap: ``'viridis'`` + A colormap name (plasma, magma, etc.) + +image.lut: ``256`` + the size of the colormap lookup table + +image.origin: ``'upper'`` + {lower, upper} + +image.resample: ``True`` + *no description* + +image.composite_image: ``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.negative_linestyle: ``'dashed'`` + string or on-off ink sequence + +contour.corner_mask: ``True`` + {True, False} + +contour.linewidth: ``None`` + {float, None} Size of the contour line widths. If set to None, it falls back to "line.linewidth". + +contour.algorithm: ``'mpl2014'`` + {mpl2005, mpl2014, serial, threaded} + +errorbar.capsize: ``0.0`` + length of end cap on error bars in pixels + +hist.bins: ``10`` + The default number of histogram bins or 'auto'. + +scatter.marker: ``'o'`` + The default marker type for scatter plots. + +scatter.edgecolors: ``'face'`` + The default edge colors for scatter plots. + +agg.path.chunksize: ``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. + +path.simplify: ``True`` + When True, simplify paths by removing "invisible" points to reduce file size and increase rendering speed + +path.simplify_threshold: ``0.111111111111`` + The threshold of similarity below which vertices will be removed in the simplification process. + +path.snap: ``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.sketch: ``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.effects: ``[]`` + *no description* + +savefig.dpi: ``'figure'`` + figure dots per inch or 'figure' + +savefig.facecolor: ``'auto'`` + figure face color when saving + +savefig.edgecolor: ``'auto'`` + figure edge color when saving + +savefig.format: ``'png'`` + {png, ps, pdf, svg} + +savefig.bbox: ``None`` + {tight, standard} 'tight' is incompatible with generating frames for animation + +savefig.pad_inches: ``0.1`` + padding to be used, when bbox is set to 'tight' + +savefig.directory: ``'~'`` + 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.transparent: ``False`` + whether figures are saved with a transparent background by default + +savefig.orientation: ``'portrait'`` + orientation of saved figure, for PostScript output only + +macosx.window_mode: ``'system'`` + How to open new figures (system, tab, window) system uses the MacOS system preferences + +tk.window_focus: ``False`` + Maintain shell focus for TkAgg + +ps.papersize: ``'letter'`` + {figure, letter, legal, ledger, A0-A10, B0-B10} + +ps.useafm: ``False`` + use AFM fonts, results in small files + +ps.usedistiller: ``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.res: ``6000`` + dpi + +ps.fonttype: ``3`` + Output Type 3 (Type3) or Type 42 (TrueType) + +pdf.compression: ``6`` + integer from 0 to 9 0 disables compression (good for debugging) + +pdf.fonttype: ``3`` + Output Type 3 (Type3) or Type 42 (TrueType) + +pdf.use14corefonts: ``False`` + *no description* + +pdf.inheritcolor: ``False`` + *no description* + +svg.image_inline: ``True`` + Write raster image data directly into the SVG file + +svg.fonttype: ``'path'`` + How to handle SVG fonts: path: Embed characters as paths -- supported by most SVG renderersnone: Assume fonts are installed on the machine where the SVG will be viewed. + +svg.hashsalt: ``None`` + If not None, use this string as hash salt instead of uuid4 + +svg.id: ``None`` + If not None, use this string as the value for the `id` attribute in the top tag + +pgf.rcfonts: ``True`` + *no description* + +pgf.preamble: ``''`` + See text.latex.preamble for documentation + +pgf.texsystem: ``'xelatex'`` + *no description* + +docstring.hardcopy: ``False`` + set this when you want to generate hardcopy docstring + +keymap.fullscreen: ``['f', 'ctrl+f']`` + toggling + +keymap.home: ``['h', 'r', 'home']`` + home or reset mnemonic + +keymap.back: ``['left', 'c', 'backspace', 'MouseButton.BACK']`` + forward / backward keys + +keymap.forward: ``['right', 'v', 'MouseButton.FORWARD']`` + for quick navigation + +keymap.pan: ``['p']`` + pan mnemonic + +keymap.zoom: ``['o']`` + zoom mnemonic + +keymap.save: ``['s', 'ctrl+s']`` + saving current figure + +keymap.help: ``['f1']`` + display help about active tools + +keymap.quit: ``['ctrl+w', 'cmd+w', 'q']`` + close the current figure + +keymap.quit_all: ``[]`` + close all figures + +keymap.grid: ``['g']`` + switching on/off major grids in current axes + +keymap.grid_minor: ``['G']`` + switching on/off minor grids in current axes + +keymap.yscale: ``['l']`` + toggle scaling of y-axes ('log'/'linear') + +keymap.xscale: ``['k', 'L']`` + toggle scaling of x-axes ('log'/'linear') + +keymap.copy: ``['ctrl+c', 'cmd+c']`` + copy figure to clipboard + +animation.html: ``'none'`` + How to display the animation as HTML in the IPython notebook: - 'html5' uses HTML5 video tag - 'jshtml' creates a JavaScript animation + +animation.writer: ``'ffmpeg'`` + MovieWriter 'backend' to use + +animation.codec: ``'h264'`` + Codec to use for writing movie + +animation.bitrate: ``-1`` + Controls size/quality trade-off for movie. -1 implies let utility auto-determine + +animation.frame_format: ``'png'`` + Controls frame format used by temp files + +animation.ffmpeg_path: ``'ffmpeg'`` + Path to ffmpeg binary. Unqualified paths are resolved by subprocess.Popen. + +animation.ffmpeg_args: ``[]`` + Additional arguments to pass to ffmpeg + +animation.convert_path: ``'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_args: ``['-layers', 'OptimizePlus']`` + Additional arguments to pass to convert + +animation.embed_limit: ``20.0`` + Limit, in MB, of size of base64 encoded animation in HTML (i.e. IPython notebook) + +_internal.classic_mode: ``False`` + *no description* + +backend: ``None`` + *no description* diff --git a/doc/users/index.rst b/doc/users/index.rst index 733f176e556c..b98bda824a7e 100644 --- a/doc/users/index.rst +++ b/doc/users/index.rst @@ -59,6 +59,7 @@ Using Matplotlib :maxdepth: 2 :includehidden: + explain/configuration explain/customizing .. grid-item-card:: diff --git a/galleries/users_explain/configuration.py b/galleries/users_explain/configuration.py new file mode 100644 index 000000000000..d5f7f38e98ff --- /dev/null +++ b/galleries/users_explain/configuration.py @@ -0,0 +1,14 @@ +""" +.. _rcparams_reference: + +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 :data:`matplotlib.rcParams` (also accessible via ``plt.rcParams``). + +The following is a comprehensive reference of all available rcParams and their +default values. + +.. include:: /users/_rcparams_generated.rst +""" diff --git a/lib/matplotlib/rcsetup.py b/lib/matplotlib/rcsetup.py index a088274b3439..cbfd8f6afca6 100644 --- a/lib/matplotlib/rcsetup.py +++ b/lib/matplotlib/rcsetup.py @@ -13,12 +13,17 @@ root source directory. """ + import ast +from dataclasses import dataclass from functools import lru_cache, reduce from numbers import Real import operator import os +from pathlib import Path import re +from typing import Any +from collections.abc import Callable import numpy as np @@ -67,6 +72,36 @@ def __call__(self, s): msg += "; remove quotes surrounding your string" raise ValueError(msg) + def __repr__(self): + return (f"{self.__class__.__name__}(" + f"key={self.key!r}, valid={[*self.valid.values()]}, " + f"ignorecase={self.ignorecase})") + + def __eq__(self, other): + if self is other: + return True + if not isinstance(other, ValidateInStrings): + return NotImplemented + return ( + self.key, + self.ignorecase, + self._deprecated_since, + tuple(sorted(self.valid.items())) + ) == ( + other.key, + other.ignorecase, + other._deprecated_since, + tuple(sorted(other.valid.items())) + ) + + def __hash__(self): + return hash(( + self.key, + self.ignorecase, + self._deprecated_since, + tuple(sorted(self.valid.items())) + )) + def _single_string_color_list(s, scalar_validator): """ @@ -215,10 +250,11 @@ def validator(s): validate_string, doc='return a list of strings') validate_int = _make_type_validator(int) validate_int_or_None = _make_type_validator(int, allow_none=True) +validate_intlist = _listify_validator(validate_int, n=2) validate_float = _make_type_validator(float) validate_float_or_None = _make_type_validator(float, allow_none=True) validate_floatlist = _listify_validator( - validate_float, doc='return a list of floats') + validate_float) def _validate_marker(s): @@ -1112,7 +1148,7 @@ def _convert_validator_spec(key, conv): "axes.labelcolor": validate_color, # color of axis label # use scientific notation if log10 of the axis range is smaller than the # first or larger than the second - "axes.formatter.limits": _listify_validator(validate_int, n=2), + "axes.formatter.limits": validate_intlist, # use current locale to format ticks "axes.formatter.use_locale": validate_bool, "axes.formatter.use_mathtext": validate_bool, @@ -1405,3 +1441,1853 @@ def _convert_validator_spec(key, conv): } _validators = {k: _convert_validator_spec(k, conv) for k, conv in _validators.items()} + + +@dataclass +class _Param: + name: str + default: Any + validator: Callable[[Any], Any] + description: str = None + + +_params = [ + _Param( + "webagg.port", + default=8988, + validator=validate_int, + description="The port to use for the web server in the WebAgg backend." + ), + _Param( + "webagg.address", + default="127.0.0.1", + validator=validate_string, + description="The address on which the WebAgg web server should be reachable." + ), + _Param( + "webagg.port_retries", + default=50, + validator=validate_int, + description="If webagg.port is unavailable, a number of other random ports " + "will be tried until one that is available is found." + ), + _Param( + "webagg.open_in_browser", + default=True, + validator=validate_bool, + description="When True, open the web browser to the plot that is shown" + ), + _Param( + "backend_fallback", + default=True, + validator=validate_bool, + description="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" + ), + _Param( + "interactive", + default=False, + validator=validate_bool + ), + _Param( + "figure.hooks", + default=[], + validator=validate_stringlist, + description="list of dotted.module.name:dotted.callable.name" + ), + _Param( + "toolbar", + default="toolbar2", + validator=_validate_toolbar, + description="{None, toolbar2, toolmanager}" + ), + _Param( + "timezone", + default="UTC", + validator=validate_string, + description="a pytz timezone string, e.g., US/Central or Europe/Paris" + ), + _Param( + "lines.linewidth", + default=1.5, + validator=validate_float, + description="line width in points" + ), + _Param( + "lines.linestyle", + default="-", + validator=_validate_linestyle, + description="solid line" + ), + _Param( + "lines.color", + default="C0", + validator=validate_color, + description="has no affect on plot(); see axes.prop_cycle" + ), + _Param( + "lines.marker", + default="None", + validator=_validate_marker, + description="the default marker" + ), + _Param( + "lines.markerfacecolor", + default="auto", + validator=validate_color_or_auto, + description="the default marker face color" + ), + _Param( + "lines.markeredgecolor", + default="auto", + validator=validate_color_or_auto, + description="the default marker edge color" + ), + _Param( + "lines.markeredgewidth", + default=1.0, + validator=validate_float, + description="the line width around the marker symbol" + ), + _Param( + "lines.markersize", + default=6.0, + validator=validate_float, + description="marker size, in points" + ), + _Param( + "lines.dash_joinstyle", + default="round", + validator=JoinStyle, + description="{miter, round, bevel}" + ), + _Param( + "lines.dash_capstyle", + default="butt", + validator=CapStyle, + description="{butt, round, projecting}" + ), + _Param( + "lines.solid_joinstyle", + default="round", + validator=JoinStyle, + description="{miter, round, bevel}" + ), + _Param( + "lines.solid_capstyle", + default="projecting", + validator=CapStyle, + description="{butt, round, projecting}" + ), + _Param( + "lines.antialiased", + default=True, + validator=validate_bool, + description="render lines in antialiased (no jaggies)" + ), + _Param( + "lines.dashed_pattern", + default=[3.7, 1.6], + validator=validate_floatlist, + description="The dash pattern for linestyle 'dashed'" + ), + _Param( + "lines.dashdot_pattern", + default=[6.4, 1.6, 1.0, 1.6], + validator=validate_floatlist, + description="The dash pattern for linestyle 'dashdot'" + ), + _Param( + "lines.dotted_pattern", + default=[1.0, 1.65], + validator=validate_floatlist, + description="The dash pattern for linestyle 'dotted'" + ), + _Param( + "lines.scale_dashes", + default=True, + validator=validate_bool + ), + _Param( + "markers.fillstyle", + default="full", + validator=validate_fillstyle, + description="{full, left, right, bottom, top, none}" + ), + _Param( + "pcolor.shading", + default="auto", + validator=["auto", "flat", "nearest", "gouraud"] + ), + _Param( + "pcolormesh.snap", + default=True, + validator=validate_bool, + description="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." + ), + _Param( + "patch.linewidth", + default=1.0, + validator=validate_float, + description="edge width in points." + ), + _Param( + "patch.facecolor", + default="C0", + validator=validate_color + ), + _Param( + "patch.edgecolor", + default="black", + validator=validate_color, + description='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.' + ), + _Param( + "patch.force_edgecolor", + default=False, + validator=validate_bool, + description="By default, Patches and Collections do not draw edges. Set this " + "to True to draw edges with patch.edgedcolor as the default " + "edgecolor. This is mainly relevant for styles." + ), + _Param( + "patch.antialiased", + default=True, + validator=validate_bool, + description="render patches in antialiased (no jaggies)" + ), + _Param("hatch.color", "edge", _validate_color_or_edge), + _Param("hatch.linewidth", 1.0, validate_float), + _Param("boxplot.notch", False, validate_bool), + _Param("boxplot.vertical", True, validate_bool), + _Param("boxplot.whiskers", 1.5, validate_whiskers), + _Param("boxplot.bootstrap", None, validate_int_or_None), + _Param("boxplot.patchartist", False, validate_bool), + _Param("boxplot.showmeans", False, validate_bool), + _Param("boxplot.showcaps", True, validate_bool), + _Param("boxplot.showbox", True, validate_bool), + _Param("boxplot.showfliers", True, validate_bool), + _Param("boxplot.meanline", False, validate_bool), + _Param("boxplot.flierprops.color", "black", validate_color), + _Param("boxplot.flierprops.marker", "o", _validate_marker), + _Param("boxplot.flierprops.markerfacecolor", "none", validate_color_or_auto), + _Param("boxplot.flierprops.markeredgecolor", "black", validate_color), + _Param("boxplot.flierprops.markeredgewidth", 1.0, validate_float), + _Param("boxplot.flierprops.markersize", 6.0, validate_float), + _Param("boxplot.flierprops.linestyle", "none", _validate_linestyle), + _Param("boxplot.flierprops.linewidth", 1.0, validate_float), + _Param("boxplot.boxprops.color", "black", validate_color), + _Param("boxplot.boxprops.linewidth", 1.0, validate_float), + _Param("boxplot.boxprops.linestyle", "-", _validate_linestyle), + _Param("boxplot.whiskerprops.color", "black", validate_color), + _Param("boxplot.whiskerprops.linewidth", 1.0, validate_float), + _Param("boxplot.whiskerprops.linestyle", "-", _validate_linestyle), + _Param("boxplot.capprops.color", "black", validate_color), + _Param("boxplot.capprops.linewidth", 1.0, validate_float), + _Param("boxplot.capprops.linestyle", "-", _validate_linestyle), + _Param("boxplot.medianprops.color", "C1", validate_color), + _Param("boxplot.medianprops.linewidth", 1.0, validate_float), + _Param("boxplot.medianprops.linestyle", "-", _validate_linestyle), + _Param("boxplot.meanprops.color", "C2", validate_color), + _Param("boxplot.meanprops.marker", "^", _validate_marker), + _Param("boxplot.meanprops.markerfacecolor", "C2", validate_color), + _Param("boxplot.meanprops.markeredgecolor", "C2", validate_color), + _Param("boxplot.meanprops.markersize", 6.0, validate_float), + _Param("boxplot.meanprops.linestyle", "--", _validate_linestyle), + _Param("boxplot.meanprops.linewidth", 1.0, validate_float), + _Param("font.family", ["sans-serif"], validate_stringlist), + _Param("font.style", "normal", validate_string), + _Param("font.variant", "normal", validate_string), + _Param("font.weight", "normal", validate_fontweight), + _Param("font.stretch", "normal", validate_fontstretch), + _Param("font.size", 10.0, validate_float), + _Param( + "font.serif", + default=[ + "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", + ], + validator=validate_stringlist + ), + _Param( + "font.sans-serif", + default=[ + "DejaVu Sans", "Bitstream Vera Sans", "Computer Modern Sans Serif", + "Lucida Grande", "Verdana", "Geneva", "Lucid", "Arial", "Helvetica", + "Avant Garde", "sans-serif", + ], + validator=validate_stringlist + ), + _Param( + "font.cursive", + default=[ + "Apple Chancery", "Textile", "Zapf Chancery", "Sand", "Script MT", "Felipa", + "Comic Neue", "Comic Sans MS", "cursive", + ], + validator=validate_stringlist + ), + _Param( + "font.fantasy", + default=["Chicago", "Charcoal", "Impact", "Western", "xkcd script", "fantasy"], + validator=validate_stringlist + ), + _Param( + "font.monospace", + default=[ + "DejaVu Sans Mono", "Bitstream Vera Sans Mono", + "Computer Modern Typewriter", "Andale Mono", "Nimbus Mono L", "Courier New", + "Courier", "Fixed", "Terminal", "monospace", + ], + validator=validate_stringlist + ), + _Param( + "font.enable_last_resort", + default=True, + validator=validate_bool, + description="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." + ), + _Param( + "text.color", + default="black", + validator=validate_color + ), + _Param("text.hinting", + default="force_autohint", + validator=[ + "default", "no_autohint", "force_autohint", "no_hinting", "auto", "native", + "either", "none", + ], + description="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.)" + ), + _Param( + "text.hinting_factor", + default=8, + validator=validate_int, + description="Specifies the amount of softness for hinting in the horizontal " + "direction. A value of 1 will hint to full pixels. A value of 2 " + "will hint to half pixels etc." + ), + _Param( + "text.kerning_factor", + default=0, + validator=validate_int, + description="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." + ), + _Param( + "text.antialiased", + default=True, + validator=validate_bool, + description="If True (default), the text will be antialiased. This only " + "affects raster outputs." + ), + _Param( + "text.parse_math", + default=True, + validator=validate_bool, + description="Use mathtext if there is an even number of unescaped dollar signs." + + ), + _Param( + "text.usetex", + default=False, + validator=validate_bool, + description="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" + ), + _Param( + "text.latex.preamble", + default="", + validator=validate_string, + description='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.' + ), + _Param( + "mathtext.fontset", + default="dejavusans", + validator=["dejavusans", "dejavuserif", "cm", "stix", "stixsans", "custom"], + description="Should be 'dejavusans' (default), 'dejavuserif', " + "'cm' (Computer Modern), 'stix', 'stixsans' or 'custom'" + ), + _Param("mathtext.bf", "sans:bold", validate_font_properties), + _Param("mathtext.bfit", "sans:italic:bold", validate_font_properties), + _Param("mathtext.cal", "cursive", validate_font_properties), + _Param("mathtext.it", "sans:italic", validate_font_properties), + _Param("mathtext.rm", "sans", validate_font_properties), + _Param("mathtext.sf", "sans", validate_font_properties), + _Param("mathtext.tt", "monospace", validate_font_properties), + _Param( + "mathtext.fallback", + default="cm", + validator=_validate_mathtext_fallback, + description="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." + ), + _Param("mathtext.default", "it", + ["rm", "cal", "bfit", "it", "tt", "sf", "bf", "default", "bb", "frak", "scr", + "regular", ], + description='The default font to use for math. Can be any of the LaTeX font ' + 'names, including the special name "regular" for the same font ' + 'used in regular text.', + ), + _Param( + "axes.facecolor", + default="white", + validator=validate_color, + description="axes background color" + ), + _Param( + "axes.edgecolor", + default="black", + validator=validate_color, + description="axes edge color" + ), + _Param( + "axes.linewidth", + default=0.8, + validator=validate_float, + description="edge line width" + ), + _Param( + "axes.grid", + default=False, + validator=validate_bool, + description="display grid or not" + ), + _Param( + "axes.grid.axis", + default="both", + validator=["x", "y", "both"], + description="which axis the grid should apply to" + ), + _Param( + "axes.grid.which", + default="major", + validator=["minor", "both", "major"], + description="grid lines at {major, minor, both} ticks" + ), + _Param( + "axes.titlelocation", + default="center", + validator=["left", "center", "right"], + description="alignment of the title: {left, right, center}" + ), + _Param( + "axes.titlesize", + default="large", + validator=validate_fontsize, + description="font size of the axes title" + ), + _Param( + "axes.titleweight", + default="normal", + validator=validate_fontweight, + description="font weight of title" + ), + _Param( + "axes.titlecolor", + default="auto", + validator=validate_color_or_auto, + description="color of the axes title, auto falls back to text.color as default " + "value" + ), + _Param( + "axes.titley", + default=None, + validator=validate_float_or_None, + description="position title (axes relative units). None implies auto" + ), + _Param( + "axes.titlepad", + default=6.0, + validator=validate_float, + description="pad between axes and title in points" + ), + _Param( + "axes.labelsize", + default="medium", + validator=validate_fontsize, + description="font size of the x and y labels" + ), + _Param( + "axes.labelpad", + default=4.0, + validator=validate_float, + description="space between label and axis" + ), + _Param( + "axes.labelweight", + default="normal", + validator=validate_fontweight, + description="weight of the x and y labels" + ), + _Param( + "axes.labelcolor", + default="black", + validator=validate_color + ), + _Param( + "axes.axisbelow", + default="line", + validator=validate_axisbelow, + description="draw axis gridlines and ticks: " + "- below patches (True) " + "- above patches but below lines ('line') " + "- above all (False)" + ), + _Param( + "axes.formatter.limits", + default=[-5, 6], + validator=validate_intlist, + description="use scientific notation if log10 of the axis range is smaller " + "than the first or larger than the second" + ), + _Param( + "axes.formatter.use_locale", + default=False, + validator=validate_bool, + description="When True, format tick labels according to the user's locale. " + "For example, use ',' as a decimal separator in the fr_FR locale." + ), + _Param( + "axes.formatter.use_mathtext", + default=False, + validator=validate_bool, + description="When True, use mathtext for scientific notation." + ), + _Param( + "axes.formatter.min_exponent", + default=0, + validator=validate_int, + description="minimum exponent to format in scientific notation" + ), + _Param( + "axes.formatter.useoffset", + default=True, + validator=validate_bool, + description="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." + ), + _Param( + "axes.formatter.offset_threshold", + default=4, + validator=validate_int, + description="When useoffset is True, the offset will be used when it can " + "remove at least this number of significant digits from tick " + "labels." + ), + _Param( + "axes.spines.left", + default=True, + validator=validate_bool, + description="display axis spines" + ), + _Param("axes.spines.bottom", True, validate_bool), + _Param("axes.spines.top", True, validate_bool), + _Param( + "axes.spines.right", + default=True, + validator=validate_bool + ), + _Param( + "axes.unicode_minus", + default=True, + validator=validate_bool, + description="use Unicode for the minus symbol rather than hyphen. See " + "https://en.wikipedia.org/wiki/Plus_and_minus_signs#Character_codes" + + ), + _Param("axes.prop_cycle", + default=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), + ], + ), + validator=validate_cycler + ), + _Param( + "axes.xmargin", + default=0.05, + validator=_validate_greaterthan_minushalf, + description="x margin. See `~.axes.Axes.margins`" + ), + _Param( + "axes.ymargin", + default=0.05, + validator=_validate_greaterthan_minushalf, + description="y margin. See `~.axes.Axes.margins`" + ), + _Param( + "axes.zmargin", + default=0.05, + validator=_validate_greaterthan_minushalf, + description="z margin. See `~.axes.Axes.margins`" + ), + _Param( + "axes.autolimit_mode", + default="data", + validator=["data", "round_numbers"], + description='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.', + ), + _Param( + "polaraxes.grid", + default=True, + validator=validate_bool, + description="display grid on polar axes" + ), + _Param( + "axes3d.grid", + default=True, + validator=validate_bool, description="display grid on 3D axes" + ), + _Param( + "axes3d.automargin", + default=False, + validator=validate_bool, + description="automatically add margin when manually setting 3D axis limits" + ), + _Param( + "axes3d.xaxis.panecolor", + default=(0.95, 0.95, 0.95, 0.5), + validator=validate_color, + description="background pane on 3D axes" + ), + _Param( + "axes3d.yaxis.panecolor", + default=(0.9, 0.9, 0.9, 0.5), + validator=validate_color, + description="background pane on 3D axes" + ), + _Param( + "axes3d.zaxis.panecolor", + default=(0.925, 0.925, 0.925, 0.5), + validator=validate_color, + description="background pane on 3D axes" + ), + _Param( + "axes3d.depthshade", + default=True, + validator=validate_bool, + description="depth shade for 3D scatter plots" + ), + _Param( + "axes3d.depthshade_minalpha", + default=0.3, + validator=validate_float, + description="minimum alpha value for depth shading" + ), + _Param( + "axes3d.mouserotationstyle", + default="arcball", + validator=["azel", "trackball", "sphere", "arcball"], + description="{azel, trackball, sphere, arcball} See also " + "https://matplotlib.org/stable/api/toolkits/mplot3d/view_angles.html#rotation-with-mouse"), # noqa + _Param( + "axes3d.trackballsize", + default=0.667, + validator=validate_float, + description="trackball diameter, in units of the Axes bbox" + ), + _Param( + "axes3d.trackballborder", + default=0.2, + validator=validate_float, + description="trackball border width, in units of the Axes bbox (only for " + "'sphere' and 'arcball' style)" + ), + _Param( + "xaxis.labellocation", + default="center", + validator=["left", "center", "right"], + description="alignment of the xaxis label: {left, right, center}" + ), + _Param( + "yaxis.labellocation", + default="center", + validator=["bottom", "center", "top"], + description="alignment of the yaxis label: {bottom, top, center}" + ), + _Param("date.autoformatter.year", "%Y", validate_string), + _Param("date.autoformatter.month", "%Y-%m", validate_string), + _Param("date.autoformatter.day", "%Y-%m-%d", validate_string), + _Param("date.autoformatter.hour", "%m-%d %H", validate_string), + _Param("date.autoformatter.minute", "%d %H:%M", validate_string), + _Param("date.autoformatter.second", "%H:%M:%S", validate_string), + _Param("date.autoformatter.microsecond", "%M:%S.%f", validate_string), + _Param( + "date.epoch", + default="1970-01-01T00:00:00", + validator=_validate_date, + description="The reference date for Matplotlib's internal date representation. " + "See https://matplotlib.org/stable/gallery/ticks/date_precision_and_epochs.html"), #noqa + _Param( + "date.converter", + default="auto", + validator=["auto", "concise"], + description="'auto', 'concise'" + ), + _Param( + "date.interval_multiples", + default=True, + validator=validate_bool, + description="For auto converter whether to use interval_multiples" + ), + _Param( + "xtick.top", + default=False, + validator=validate_bool, + description="draw ticks on the top side" + ), + _Param( + "xtick.bottom", + default=True, + validator=validate_bool, + description="draw ticks on the bottom side" + ), + _Param( + "xtick.labeltop", + default=False, + validator=validate_bool, + description="draw label on the top" + ), + _Param( + "xtick.labelbottom", + default=True, + validator=validate_bool, + description="draw label on the bottom" + ), + _Param( + "xtick.major.size", + default=3.5, + validator=validate_float, + description="major tick size in points" + ), + _Param( + "xtick.minor.size", + default=2.0, + validator=validate_float, + description="minor tick size in points" + ), + _Param( + "xtick.major.width", + default=0.8, + validator=validate_float, + description="major tick width in points" + ), + _Param( + "xtick.minor.width", + default=0.6, + validator=validate_float, + description="minor tick width in points" + ), + _Param( + "xtick.major.pad", + default=3.5, + validator=validate_float, + description="distance to major tick label in points" + ), + _Param( + "xtick.minor.pad", + default=3.4, + validator=validate_float, + description="distance to the minor tick label in points" + ), + _Param( + "xtick.color", + default="black", + validator=validate_color, + description="color of the ticks" + ), + _Param( + "xtick.labelcolor", + default="inherit", + validator=validate_color_or_inherit, + description="color of the tick labels or inherit from xtick.color" + ), + _Param( + "xtick.labelsize", + default="medium", + validator=validate_fontsize, + description="font size of the tick labels" + ), + _Param( + "xtick.direction", + default="out", + validator=["out", "in", "inout"], + description="direction: {in, out, inout}" + ), + _Param( + "xtick.minor.visible", + default=False, + validator=validate_bool, + description="visibility of minor ticks on x-axis" + ), + _Param( + "xtick.major.top", + default=True, + validator=validate_bool, + description="draw x axis top major ticks" + ), + _Param( + "xtick.major.bottom", + default=True, + validator=validate_bool, + description="draw x axis bottom major ticks" + ), + _Param( + "xtick.minor.top", + default=True, + validator=validate_bool, + description="draw x axis top minor ticks" + ), + _Param( + "xtick.minor.bottom", + default=True, + validator=validate_bool, + description="draw x axis bottom minor ticks" + ), + _Param( + "xtick.minor.ndivs", + default="auto", + validator=_validate_minor_tick_ndivs, + description="number of minor ticks between the major ticks on x-axis" + ), + _Param( + "xtick.alignment", + default="center", + validator=["center", "right", "left"], + description="alignment of xticks" + ), + _Param( + "ytick.left", + default=True, + validator=validate_bool, + description="draw ticks on the left side" + ), + _Param( + "ytick.right", + default=False, + validator=validate_bool, + description="draw ticks on the right side" + ), + _Param( + "ytick.labelleft", + default=True, + validator=validate_bool, + description="draw tick labels on the left side" + ), + _Param( + "ytick.labelright", + default=False, + validator=validate_bool, + description="draw tick labels on the right side" + ), + _Param( + "ytick.major.size", + default=3.5, + validator=validate_float, + description="major tick size in points" + ), + _Param( + "ytick.minor.size", + default=2.0, + validator=validate_float, + description="minor tick size in points" + ), + _Param( + "ytick.major.width", + default=0.8, + validator=validate_float, + description="major tick width in points" + ), + _Param( + "ytick.minor.width", + default=0.6, + validator=validate_float, + description="minor tick width in points" + ), + _Param( + "ytick.major.pad", + default=3.5, + validator=validate_float, + description="distance to major tick label in points" + ), + _Param( + "ytick.minor.pad", + default=3.4, + validator=validate_float, + description="distance to the minor tick label in points" + ), + _Param( + "ytick.color", + default="black", + validator=validate_color, + description="color of the ticks" + ), + _Param( + "ytick.labelcolor", + default="inherit", + validator=validate_color_or_inherit, + description="color of the tick labels or inherit from ytick.color" + ), + _Param( + "ytick.labelsize", + default="medium", + validator=validate_fontsize, + description="font size of the tick labels" + ), + _Param( + "ytick.direction", + default="out", + validator=["out", "in", "inout"], + description="direction: {in, out, inout}" + ), + _Param( + "ytick.minor.visible", + default=False, + validator=validate_bool, + description="visibility of minor ticks on y-axis" + ), + _Param( + "ytick.major.left", + default=True, + validator=validate_bool, + description="draw y axis left major ticks" + ), + _Param( + "ytick.major.right", + default=True, + validator=validate_bool, + description="draw y axis right major ticks" + ), + _Param( + "ytick.minor.left", + default=True, + validator=validate_bool, + description="draw y axis left minor ticks" + ), + _Param( + "ytick.minor.right", + default=True, + validator=validate_bool, + description="draw y axis right minor ticks" + ), + _Param( + "ytick.minor.ndivs", + default="auto", + validator=_validate_minor_tick_ndivs, + description="number of minor ticks between the major ticks on y-axis" + ), + _Param("ytick.alignment", "center_baseline", + ["center", "top", "bottom", "baseline", "center_baseline"], + description="alignment of yticks" + ), + _Param( + "grid.color", + default="#b0b0b0", + validator=validate_color, + description='b0b0b0" # grid color' + ), + _Param( + "grid.linestyle", + default="-", + validator=_validate_linestyle, + description="solid" + ), + _Param( + "grid.linewidth", + default=0.8, + validator=validate_float, + description="in points" + ), + _Param( + "grid.alpha", + default=1.0, + validator=validate_float, + description="transparency, between 0.0 and 1.0" + ), + _Param( + "grid.major.color", + default=None, + validator=_validate_color_or_None, + description="If None defaults to grid.color" + ), + _Param( + "grid.major.linestyle", + default=None, + validator=_validate_linestyle_or_None, + description="If None defaults to grid.linestyle" + ), + _Param( + "grid.major.linewidth", + default=None, + validator=validate_float_or_None, + description="If None defaults to grid.linewidth" + ), + _Param( + "grid.major.alpha", + default=None, + validator=validate_float_or_None, + description="If None defaults to grid.alpha" + ), + _Param( + "grid.minor.color", + default=None, + validator=_validate_color_or_None, + description="If None defaults to grid.color" + ), + _Param( + "grid.minor.linestyle", + default=None, + validator=_validate_linestyle_or_None, + description="If None defaults to grid.linestyle" + ), + _Param( + "grid.minor.linewidth", + default=None, + validator=validate_float_or_None, + description="If None defaults to grid.linewidth" + ), + _Param( + "grid.minor.alpha", + default=None, + validator=validate_float_or_None, + description="If None defaults to grid.alpha" + ), + _Param( + "legend.loc", + default="best", + validator=_validate_legend_loc + ), + _Param( + "legend.frameon", + default=True, + validator=validate_bool, + description="if True, draw the legend on a background patch" + ), + _Param( + "legend.framealpha", + default=0.8, + validator=validate_float_or_None, + description="legend patch transparency" + ), + _Param( + "legend.facecolor", + default="inherit", + validator=validate_color_or_inherit, + description="inherit from axes.facecolor; or color spec" + ), + _Param( + "legend.edgecolor", + default="0.8", + validator=validate_color_or_inherit, + description="background patch boundary color" + ), + _Param( + "legend.linewidth", + default=None, + validator=validate_float_or_None, + description="line width of the legend frame, None means inherit from " + "patch.linewidth" + ), + _Param( + "legend.fancybox", + default=True, + validator=validate_bool, + description="if True, use a rounded box for the legend background, else a " + "rectangle" + ), + _Param( + "legend.shadow", + default=False, + validator=validate_bool, + description="if True, give background a shadow effect" + ), + _Param( + "legend.numpoints", + default=1, + validator=validate_int, + description="the number of marker points in the legend line" + ), + _Param( + "legend.scatterpoints", + default=1, + validator=validate_int, + description="number of scatter points" + ), + _Param( + "legend.markerscale", + default=1.0, + validator=validate_float, + description="the relative size of legend markers vs. original" + ), + _Param( + "legend.fontsize", + default="medium", + validator=validate_fontsize + ), + _Param( + "legend.labelcolor", + default="None", + validator=_validate_color_or_linecolor + ), + _Param( + "legend.title_fontsize", + default=None, + validator=validate_fontsize_None, + description="None sets to the same as the default axes." + ), + _Param( + "legend.borderpad", + default=0.4, + validator=validate_float, + description="border whitespace" + ), + _Param( + "legend.labelspacing", + default=0.5, + validator=validate_float, + description="the vertical space between the legend entries" + ), + _Param( + "legend.handlelength", + default=2.0, + validator=validate_float, + description="the length of the legend lines" + ), + _Param( + "legend.handleheight", + default=0.7, + validator=validate_float, + description="the height of the legend handle" + ), + _Param( + "legend.handletextpad", + default=0.8, + validator=validate_float, + description="the space between the legend line and legend text" + ), + _Param( + "legend.borderaxespad", + default=0.5, + validator=validate_float, + description="the border between the axes and legend edge" + ), + _Param( + "legend.columnspacing", + default=2.0, + validator=validate_float, description="column separation" + ), + _Param( + "figure.titlesize", + default="large", + validator=validate_fontsize, + description="size of the figure title (``Figure.suptitle()``)" + ), + _Param( + "figure.titleweight", + default="normal", + validator=validate_fontweight, + description="weight of the figure title" + ), + _Param( + "figure.labelsize", + default="large", + validator=validate_fontsize, + description="size of the figure label (``Figure.sup[x|y]label()``)" + ), + _Param( + "figure.labelweight", + default="normal", + validator=validate_fontweight, + description="weight of the figure label" + ), + _Param( + "figure.figsize", + default=[6.4, 4.8], + validator=_listify_validator(validate_float, n=2), + description="figure size in inches" + ), + _Param( + "figure.dpi", + default=100.0, + validator=validate_float, description="figure dots per inch" + ), + _Param( + "figure.facecolor", + default="white", + validator=validate_color, description="figure face color" + ), + _Param( + "figure.edgecolor", + default="white", + validator=validate_color, description="figure edge color" + ), + _Param( + "figure.frameon", + default=True, + validator=validate_bool, description="enable figure frame" + ), + _Param( + "figure.max_open_warning", + default=20, + validator=validate_int, + description="The maximum number of figures to open through the pyplot " + "interface before emitting a warning. If less than one this " + "feature is disabled." + ), + _Param( + "figure.raise_window", + default=True, + validator=validate_bool, + description="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." + ), + _Param( + "figure.subplot.left", + default=0.125, + validator=validate_float, + description="the left side of the subplots of the figure" + ), + _Param( + "figure.subplot.right", + default=0.9, + validator=validate_float, + description="the right side of the subplots of the figure" + ), + _Param( + "figure.subplot.bottom", + default=0.11, + validator=validate_float, + description="the bottom of the subplots of the figure" + ), + _Param( + "figure.subplot.top", + default=0.88, + validator=validate_float, + description="the top of the subplots of the figure" + ), + _Param( + "figure.subplot.wspace", + default=0.2, + validator=validate_float, + description="the amount of width reserved for space between subplots, " + "expressed as a fraction of the average axis width" + ), + _Param( + "figure.subplot.hspace", + default=0.2, + validator=validate_float, + description="the amount of height reserved for space between subplots, " + "expressed as a fraction of the average axis height" + ), + _Param( + "figure.autolayout", + default=False, + validator=validate_bool, + description="When True, automatically adjust subplot parameters to make the " + "plot fit the figure using `~.Figure.tight_layout`" + ), + _Param( + "figure.constrained_layout.use", + default=False, + validator=validate_bool, + description="When True, automatically make plot elements fit on the figure. " + '(Not compatible with "figure.autolayout", above).' + ), + _Param( + "figure.constrained_layout.h_pad", + default=0.04167, + validator=validate_float, + description="Padding (in inches) around axes; defaults to 3/72 inches, " + "i.e. 3 points" + ), + _Param( + "figure.constrained_layout.w_pad", + default=0.04167, + validator=validate_float, + description="Padding (in inches) around axes; defaults to 3/72 inches, " + "i.e. 3 points" + ), + _Param( + "figure.constrained_layout.hspace", + default=0.02, + validator=validate_float, + description="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." + ), + _Param( + "figure.constrained_layout.wspace", + default=0.02, + validator=validate_float, + description="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." + ), + _Param( + "image.aspect", + default="equal", + validator=validate_aspect, + description="{equal, auto} or a number" + ), + _Param( + "image.interpolation", + default="auto", + validator=validate_string, + description="see help(imshow) for options" + ), + _Param( + "image.interpolation_stage", + default="auto", + validator=["auto", "data", "rgba"], + description="see help(imshow) for options" + ), + _Param( + "image.cmap", + default="viridis", + validator=_validate_cmap, + description="A colormap name (plasma, magma, etc.)" + ), + _Param( + "image.lut", + default=256, + validator=validate_int, + description="the size of the colormap lookup table" + ), + _Param( + "image.origin", + default="upper", + validator=["upper", "lower"], description="{lower, upper}" + ), + _Param( + "image.resample", + default=True, + validator=validate_bool + ), + _Param( + "image.composite_image", + default=True, + validator=validate_bool, + description="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." + ), + _Param( + "contour.negative_linestyle", + default="dashed", + validator=_validate_linestyle, + description="string or on-off ink sequence" + ), + _Param( + "contour.corner_mask", + default=True, + validator=validate_bool, description="{True, False}" + ), + _Param( + "contour.linewidth", + default=None, + validator=validate_float_or_None, + description="{float, None} Size of the contour line widths. If set to None, it " + 'falls back to "line.linewidth".' + ), + _Param( + "contour.algorithm", + default="mpl2014", + validator=["mpl2005", "mpl2014", "serial", "threaded"], + description="{mpl2005, mpl2014, serial, threaded}" + ), + _Param( + "errorbar.capsize", + default=0.0, + validator=validate_float, + description="length of end cap on error bars in pixels" + ), + _Param( + "hist.bins", + default=10, + validator=validate_hist_bins, + description="The default number of histogram bins or 'auto'." + ), + _Param( + "scatter.marker", + default="o", + validator=_validate_marker, + description="The default marker type for scatter plots." + ), + _Param( + "scatter.edgecolors", + default="face", + validator=validate_string, + description="The default edge colors for scatter plots." + ), + _Param( + "agg.path.chunksize", + default=0, + validator=validate_int, + description="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." + ), + _Param( + "path.simplify", + default=True, + validator=validate_bool, + description='When True, simplify paths by removing "invisible" points to ' + 'reduce file size and increase rendering speed', + ), + _Param( + "path.simplify_threshold", + default=0.111111111111, + validator=_validate_greaterequal0_lessequal1, + description="The threshold of similarity below which vertices will be removed " + "in the simplification process." + ), + _Param( + "path.snap", + default=True, + validator=validate_bool, + description="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." + ), + _Param( + "path.sketch", + default=None, + validator=validate_sketch, + description="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." + ), + _Param( + "path.effects", + default=[], + validator=validate_anylist + ), + _Param( + "savefig.dpi", + default="figure", + validator=validate_dpi, + description="figure dots per inch or 'figure'" + ), + _Param( + "savefig.facecolor", + default="auto", + validator=validate_color_or_auto, + description="figure face color when saving" + ), + _Param( + "savefig.edgecolor", + default="auto", + validator=validate_color_or_auto, + description="figure edge color when saving" + ), + _Param( + "savefig.format", + default="png", + validator=validate_string, description="{png, ps, pdf, svg}" + ), + _Param( + "savefig.bbox", + default=None, + validator=validate_bbox, + description="{tight, standard} 'tight' is incompatible with generating frames " + "for animation" + ), + _Param( + "savefig.pad_inches", + default=0.1, + validator=validate_float, + description="padding to be used, when bbox is set to 'tight'" + ), + _Param( + "savefig.directory", + default="~", + validator=_validate_pathlike, + description="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" + ), + _Param( + "savefig.transparent", + default=False, + validator=validate_bool, + description="whether figures are saved with a transparent background by default" + + ), + _Param( + "savefig.orientation", + default="portrait", + validator=["landscape", "portrait"], + description="orientation of saved figure, for PostScript output only" + ), + _Param( + "macosx.window_mode", + default="system", + validator=["system", "tab", "window"], + description="How to open new figures (system, tab, window) system uses " + "the MacOS system preferences" + ), + _Param( + "tk.window_focus", + default=False, + validator=validate_bool, + description="Maintain shell focus for TkAgg" + ), + _Param( + "ps.papersize", + default="letter", + validator=_ignorecase( + ["figure", "letter", "legal", "ledger", + *[f"{ab}{i}" for ab in "ab" for i in range(11)], + ], + ), + description="{figure, letter, legal, ledger, A0-A10, B0-B10}" + ), + _Param( + "ps.useafm", + default=False, + validator=validate_bool, + description="use AFM fonts, results in small files" + ), + _Param( + "ps.usedistiller", + default=None, + validator=validate_ps_distiller, + description="{ghostscript, xpdf, None} Experimental: may produce smaller " + "files. xpdf intended for production of publication quality files, " + "but requires ghostscript, xpdf and ps2eps" + ), + _Param( + "ps.distiller.res", + default=6000, + validator=validate_int, description="dpi" + ), + _Param( + "ps.fonttype", + default=3, + validator=validate_fonttype, + description="Output Type 3 (Type3) or Type 42 (TrueType)" + ), + _Param( + "pdf.compression", + default=6, + validator=validate_int, + description="integer from 0 to 9 0 disables compression (good for debugging)" + ), + _Param( + "pdf.fonttype", + default=3, + validator=validate_fonttype, + description="Output Type 3 (Type3) or Type 42 (TrueType)" + ), + _Param( + "pdf.use14corefonts", + default=False, + validator=validate_bool + ), + _Param( + "pdf.inheritcolor", + default=False, + validator=validate_bool + ), + _Param( + "svg.image_inline", + default=True, + validator=validate_bool, + description="Write raster image data directly into the SVG file" + ), + _Param( + "svg.fonttype", + default="path", + validator=["none", "path"], + description="How to handle SVG fonts: " + "path: Embed characters as paths -- supported by most SVG " + " renderers" + "none: Assume fonts are installed on the machine where the SVG " + "will be viewed." + ), + _Param( + "svg.hashsalt", + default=None, + validator=validate_string_or_None, + description="If not None, use this string as hash salt instead of uuid4" + ), + _Param( + "svg.id", + default=None, + validator=validate_string_or_None, + description="If not None, use this string as the value for the `id` attribute " + "in the top tag" + ), + _Param( + "pgf.rcfonts", + default=True, + validator=validate_bool + ), + _Param( + "pgf.preamble", + default="", + validator=validate_string, + description="See text.latex.preamble for documentation" + ), + _Param( + "pgf.texsystem", + default="xelatex", + validator=["xelatex", "lualatex", "pdflatex"] + ), + _Param( + "docstring.hardcopy", + default=False, + validator=validate_bool, + description="set this when you want to generate hardcopy docstring" + ), + _Param( + "keymap.fullscreen", + default=["f", "ctrl+f"], + validator=validate_stringlist, + description="toggling" + ), + _Param( + "keymap.home", + default=["h", "r", "home"], + validator=validate_stringlist, + description="home or reset mnemonic" + ), + _Param( + "keymap.back", + default=["left", "c", "backspace", "MouseButton.BACK"], + validator=validate_stringlist, description="forward / backward keys" + ), + _Param( + "keymap.forward", + default=["right", "v", "MouseButton.FORWARD"], + validator=validate_stringlist, + description="for quick navigation" + ), + _Param( + "keymap.pan", + default=["p"], + validator=validate_stringlist, description="pan mnemonic" + ), + _Param( + "keymap.zoom", + default=["o"], + validator=validate_stringlist, description="zoom mnemonic" + ), + _Param( + "keymap.save", + default=["s", "ctrl+s"], + validator=validate_stringlist, + description="saving current figure" + ), + _Param( + "keymap.help", + default=["f1"], + validator=validate_stringlist, + description="display help about active tools" + ), + _Param( + "keymap.quit", + default=["ctrl+w", "cmd+w", "q"], + validator=validate_stringlist, + description="close the current figure" + ), + _Param( + "keymap.quit_all", + default=[], + validator=validate_stringlist, description="close all figures" + ), + _Param( + "keymap.grid", + default=["g"], + validator=validate_stringlist, + description="switching on/off major grids in current axes" + ), + _Param( + "keymap.grid_minor", + default=["G"], + validator=validate_stringlist, + description="switching on/off minor grids in current axes" + ), + _Param( + "keymap.yscale", + default=["l"], + validator=validate_stringlist, + description="toggle scaling of y-axes ('log'/'linear')" + ), + _Param( + "keymap.xscale", + default=["k", "L"], + validator=validate_stringlist, + description="toggle scaling of x-axes ('log'/'linear')" + ), + _Param( + "keymap.copy", + default=["ctrl+c", "cmd+c"], + validator=validate_stringlist, + description="copy figure to clipboard" + ), + _Param( + "animation.html", + default="none", + validator=["html5", "jshtml", "none"], + description="How to display the animation as HTML in the IPython notebook: " + "- 'html5' uses HTML5 video tag " + "- 'jshtml' creates a JavaScript animation" + ), + _Param( + "animation.writer", + default="ffmpeg", + validator=validate_string, + description="MovieWriter 'backend' to use" + ), + _Param( + "animation.codec", + default="h264", + validator=validate_string, + description="Codec to use for writing movie" + ), + _Param( + "animation.bitrate", + default=-1, + validator=validate_int, + description="Controls size/quality trade-off for movie. -1 implies let " + "utility auto-determine" + ), + _Param("animation.frame_format", "png", + ["png", "jpeg", "tiff", "raw", "rgba", "ppm", "sgi", "bmp", "pbm", "svg"], + description="Controls frame format used by temp files" + ), + _Param( + "animation.ffmpeg_path", + default="ffmpeg", + validator=_validate_pathlike, + description="Path to ffmpeg binary. Unqualified paths are resolved by " + "subprocess.Popen." + ), + _Param( + "animation.ffmpeg_args", + default=[], + validator=validate_stringlist, + description="Additional arguments to pass to ffmpeg" + ), + _Param( + "animation.convert_path", + default="convert", + validator=_validate_pathlike, + description="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)." + ), + _Param( + "animation.convert_args", + default=["-layers", "OptimizePlus"], + validator=validate_stringlist, + description="Additional arguments to pass to convert" + ), + _Param( + "animation.embed_limit", + default=20.0, + validator=validate_float, + description="Limit, in MB, of size of base64 encoded animation in HTML (i.e. " + "IPython notebook)" + ), + _Param( + "_internal.classic_mode", + default=False, + validator=validate_bool + ), + _Param("backend", None, validate_backend), +] + + +def _generate_rst(): # pragma: no cover + """ + Generate rst documentation for rcParams. + + Note: The style is very simple, but will be refined later. + """ + + text = """\ +.. + autogenerated rcParams documentation. Update via + > python -c "from matplotlib import rcsetup; rcsetup._write_rcParam_rst()" + +""" + for param in _params: + text += f""" +{param.name}: ``{param.default!r}`` + {param.description if param.description else "*no description*"} +""" + return text + + +def _write_rcParam_rst(): # pragma: no cover + """Write the generated rst documentation to /users/_rcparams_generated.rst.""" + docpath = Path(os.path.dirname(__file__)) / "../../doc" + if not docpath.exists(): + raise RuntimeError("Cannot find the doc/api/ directory") + + (docpath / "users/_rcparams_generated.rst").write_text(_generate_rst()) diff --git a/lib/matplotlib/rcsetup.pyi b/lib/matplotlib/rcsetup.pyi index c6611845723d..120c0c93bec9 100644 --- a/lib/matplotlib/rcsetup.pyi +++ b/lib/matplotlib/rcsetup.pyi @@ -33,6 +33,7 @@ def validate_string_or_None(s: Any) -> str | None: ... def validate_stringlist(s: Any) -> list[str]: ... def validate_int(s: Any) -> int: ... def validate_int_or_None(s: Any) -> int | None: ... +def validate_intlist(s: Any) -> list[int]: ... def validate_float(s: Any) -> float: ... def validate_float_or_None(s: Any) -> float | None: ... def validate_floatlist(s: Any) -> list[float]: ... diff --git a/lib/matplotlib/sphinxext/roles.py b/lib/matplotlib/sphinxext/roles.py index c3e57ebc3aec..0b696f830543 100644 --- a/lib/matplotlib/sphinxext/roles.py +++ b/lib/matplotlib/sphinxext/roles.py @@ -78,6 +78,22 @@ def _depart_query_reference_node(self, node): self.depart_literal(node) +# We sometimes want to use special notation in rcParam references, e.g. +# to use wildcards. This mapping maps such special notations to real rcParams, +# typically to the first relevant parameter in the group. +_RC_WILDCARD_LINK_MAPPING = { + "animation.[name-of-encoder]_args": "animation.ffmpeg_args", + "figure.subplot.*": "figure.subplot.left", + "figure.subplot.[name]": "figure.subplot.left", + "font.*": "font.family", + "lines.*": "lines.linewidth", + "patch.*": "patch.edgecolor", + "grid.major.*": "grid.major.color", + "grid.minor.*": "grid.minor.color", + "grid.*": "grid.color", +} + + def _rcparam_role(name, rawtext, text, lineno, inliner, options=None, content=None): """ Sphinx role ``:rc:`` to highlight and link ``rcParams`` entries. @@ -89,7 +105,8 @@ def _rcparam_role(name, rawtext, text, lineno, inliner, options=None, content=No # Generate a pending cross-reference so that Sphinx will ensure this link # isn't broken at some point in the future. title = f'rcParams["{text}"]' - target = 'matplotlibrc-sample' + rc_param_name = _RC_WILDCARD_LINK_MAPPING.get(text, text) + target = f'rcparam_{rc_param_name.replace(".", "_")}' ref_nodes, messages = inliner.interpreted(title, f'{title} <{target}>', 'ref', lineno) diff --git a/lib/matplotlib/tests/test_rcparams.py b/lib/matplotlib/tests/test_rcparams.py index 2235f98b720f..eb9d3bc8866b 100644 --- a/lib/matplotlib/tests/test_rcparams.py +++ b/lib/matplotlib/tests/test_rcparams.py @@ -13,6 +13,7 @@ import matplotlib.pyplot as plt import matplotlib.colors as mcolors import numpy as np +from matplotlib import rcsetup from matplotlib.rcsetup import ( validate_bool, validate_color, @@ -672,3 +673,21 @@ def test_rc_aliases(group, option, alias, value): rcParams_key = f"{group}.{option}" assert mpl.rcParams[rcParams_key] == value + + +def test_all_params_defined_as_code(): + assert set(p.name for p in rcsetup._params) == set(mpl.rcParams.keys()) + + +def test_validators_defined_as_code(): + for param in rcsetup._params: + validator = rcsetup._convert_validator_spec(param.name, param.validator) + assert validator == rcsetup._validators[param.name] + + +def test_defaults_as_code(): + for param in rcsetup._params: + if param.name == 'backend': + # backend has special handling and no meaningful default + continue + assert param.default == mpl.rcParamsDefault[param.name], param.name From f8971f1cf2a9d7aace18ac63bdf8f2b39314ce2f Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Fri, 19 Dec 2025 13:32:57 +0100 Subject: [PATCH 2/3] Link to individual rcParams descriptions --- doc/users/_rcparams_generated.rst | 668 ++++++++++++++++++++++++++++++ lib/matplotlib/rcsetup.py | 2 + 2 files changed, 670 insertions(+) diff --git a/doc/users/_rcparams_generated.rst b/doc/users/_rcparams_generated.rst index 42a8575413bf..19f972771ea9 100644 --- a/doc/users/_rcparams_generated.rst +++ b/doc/users/_rcparams_generated.rst @@ -3,1004 +3,1672 @@ > python -c "from matplotlib import rcsetup; rcsetup._write_rcParam_rst()" +.. _rcparam_webagg_port: + webagg.port: ``8988`` The port to use for the web server in the WebAgg backend. +.. _rcparam_webagg_address: + webagg.address: ``'127.0.0.1'`` The address on which the WebAgg web server should be reachable. +.. _rcparam_webagg_port_retries: + webagg.port_retries: ``50`` If webagg.port is unavailable, a number of other random ports will be tried until one that is available is found. +.. _rcparam_webagg_open_in_browser: + webagg.open_in_browser: ``True`` When True, open the web browser to the plot that is shown +.. _rcparam_backend_fallback: + backend_fallback: ``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 +.. _rcparam_interactive: + interactive: ``False`` *no description* +.. _rcparam_figure_hooks: + figure.hooks: ``[]`` list of dotted.module.name:dotted.callable.name +.. _rcparam_toolbar: + toolbar: ``'toolbar2'`` {None, toolbar2, toolmanager} +.. _rcparam_timezone: + timezone: ``'UTC'`` a pytz timezone string, e.g., US/Central or Europe/Paris +.. _rcparam_lines_linewidth: + lines.linewidth: ``1.5`` line width in points +.. _rcparam_lines_linestyle: + lines.linestyle: ``'-'`` solid line +.. _rcparam_lines_color: + lines.color: ``'C0'`` has no affect on plot(); see axes.prop_cycle +.. _rcparam_lines_marker: + lines.marker: ``'None'`` the default marker +.. _rcparam_lines_markerfacecolor: + lines.markerfacecolor: ``'auto'`` the default marker face color +.. _rcparam_lines_markeredgecolor: + lines.markeredgecolor: ``'auto'`` the default marker edge color +.. _rcparam_lines_markeredgewidth: + lines.markeredgewidth: ``1.0`` the line width around the marker symbol +.. _rcparam_lines_markersize: + lines.markersize: ``6.0`` marker size, in points +.. _rcparam_lines_dash_joinstyle: + lines.dash_joinstyle: ``'round'`` {miter, round, bevel} +.. _rcparam_lines_dash_capstyle: + lines.dash_capstyle: ``'butt'`` {butt, round, projecting} +.. _rcparam_lines_solid_joinstyle: + lines.solid_joinstyle: ``'round'`` {miter, round, bevel} +.. _rcparam_lines_solid_capstyle: + lines.solid_capstyle: ``'projecting'`` {butt, round, projecting} +.. _rcparam_lines_antialiased: + lines.antialiased: ``True`` render lines in antialiased (no jaggies) +.. _rcparam_lines_dashed_pattern: + lines.dashed_pattern: ``[3.7, 1.6]`` The dash pattern for linestyle 'dashed' +.. _rcparam_lines_dashdot_pattern: + lines.dashdot_pattern: ``[6.4, 1.6, 1.0, 1.6]`` The dash pattern for linestyle 'dashdot' +.. _rcparam_lines_dotted_pattern: + lines.dotted_pattern: ``[1.0, 1.65]`` The dash pattern for linestyle 'dotted' +.. _rcparam_lines_scale_dashes: + lines.scale_dashes: ``True`` *no description* +.. _rcparam_markers_fillstyle: + markers.fillstyle: ``'full'`` {full, left, right, bottom, top, none} +.. _rcparam_pcolor_shading: + pcolor.shading: ``'auto'`` *no description* +.. _rcparam_pcolormesh_snap: + pcolormesh.snap: ``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. +.. _rcparam_patch_linewidth: + patch.linewidth: ``1.0`` edge width in points. +.. _rcparam_patch_facecolor: + patch.facecolor: ``'C0'`` *no description* +.. _rcparam_patch_edgecolor: + patch.edgecolor: ``'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. +.. _rcparam_patch_force_edgecolor: + patch.force_edgecolor: ``False`` By default, Patches and Collections do not draw edges. Set this to True to draw edges with patch.edgedcolor as the default edgecolor. This is mainly relevant for styles. +.. _rcparam_patch_antialiased: + patch.antialiased: ``True`` render patches in antialiased (no jaggies) +.. _rcparam_hatch_color: + hatch.color: ``'edge'`` *no description* +.. _rcparam_hatch_linewidth: + hatch.linewidth: ``1.0`` *no description* +.. _rcparam_boxplot_notch: + boxplot.notch: ``False`` *no description* +.. _rcparam_boxplot_vertical: + boxplot.vertical: ``True`` *no description* +.. _rcparam_boxplot_whiskers: + boxplot.whiskers: ``1.5`` *no description* +.. _rcparam_boxplot_bootstrap: + boxplot.bootstrap: ``None`` *no description* +.. _rcparam_boxplot_patchartist: + boxplot.patchartist: ``False`` *no description* +.. _rcparam_boxplot_showmeans: + boxplot.showmeans: ``False`` *no description* +.. _rcparam_boxplot_showcaps: + boxplot.showcaps: ``True`` *no description* +.. _rcparam_boxplot_showbox: + boxplot.showbox: ``True`` *no description* +.. _rcparam_boxplot_showfliers: + boxplot.showfliers: ``True`` *no description* +.. _rcparam_boxplot_meanline: + boxplot.meanline: ``False`` *no description* +.. _rcparam_boxplot_flierprops_color: + boxplot.flierprops.color: ``'black'`` *no description* +.. _rcparam_boxplot_flierprops_marker: + boxplot.flierprops.marker: ``'o'`` *no description* +.. _rcparam_boxplot_flierprops_markerfacecolor: + boxplot.flierprops.markerfacecolor: ``'none'`` *no description* +.. _rcparam_boxplot_flierprops_markeredgecolor: + boxplot.flierprops.markeredgecolor: ``'black'`` *no description* +.. _rcparam_boxplot_flierprops_markeredgewidth: + boxplot.flierprops.markeredgewidth: ``1.0`` *no description* +.. _rcparam_boxplot_flierprops_markersize: + boxplot.flierprops.markersize: ``6.0`` *no description* +.. _rcparam_boxplot_flierprops_linestyle: + boxplot.flierprops.linestyle: ``'none'`` *no description* +.. _rcparam_boxplot_flierprops_linewidth: + boxplot.flierprops.linewidth: ``1.0`` *no description* +.. _rcparam_boxplot_boxprops_color: + boxplot.boxprops.color: ``'black'`` *no description* +.. _rcparam_boxplot_boxprops_linewidth: + boxplot.boxprops.linewidth: ``1.0`` *no description* +.. _rcparam_boxplot_boxprops_linestyle: + boxplot.boxprops.linestyle: ``'-'`` *no description* +.. _rcparam_boxplot_whiskerprops_color: + boxplot.whiskerprops.color: ``'black'`` *no description* +.. _rcparam_boxplot_whiskerprops_linewidth: + boxplot.whiskerprops.linewidth: ``1.0`` *no description* +.. _rcparam_boxplot_whiskerprops_linestyle: + boxplot.whiskerprops.linestyle: ``'-'`` *no description* +.. _rcparam_boxplot_capprops_color: + boxplot.capprops.color: ``'black'`` *no description* +.. _rcparam_boxplot_capprops_linewidth: + boxplot.capprops.linewidth: ``1.0`` *no description* +.. _rcparam_boxplot_capprops_linestyle: + boxplot.capprops.linestyle: ``'-'`` *no description* +.. _rcparam_boxplot_medianprops_color: + boxplot.medianprops.color: ``'C1'`` *no description* +.. _rcparam_boxplot_medianprops_linewidth: + boxplot.medianprops.linewidth: ``1.0`` *no description* +.. _rcparam_boxplot_medianprops_linestyle: + boxplot.medianprops.linestyle: ``'-'`` *no description* +.. _rcparam_boxplot_meanprops_color: + boxplot.meanprops.color: ``'C2'`` *no description* +.. _rcparam_boxplot_meanprops_marker: + boxplot.meanprops.marker: ``'^'`` *no description* +.. _rcparam_boxplot_meanprops_markerfacecolor: + boxplot.meanprops.markerfacecolor: ``'C2'`` *no description* +.. _rcparam_boxplot_meanprops_markeredgecolor: + boxplot.meanprops.markeredgecolor: ``'C2'`` *no description* +.. _rcparam_boxplot_meanprops_markersize: + boxplot.meanprops.markersize: ``6.0`` *no description* +.. _rcparam_boxplot_meanprops_linestyle: + boxplot.meanprops.linestyle: ``'--'`` *no description* +.. _rcparam_boxplot_meanprops_linewidth: + boxplot.meanprops.linewidth: ``1.0`` *no description* +.. _rcparam_font_family: + font.family: ``['sans-serif']`` *no description* +.. _rcparam_font_style: + font.style: ``'normal'`` *no description* +.. _rcparam_font_variant: + font.variant: ``'normal'`` *no description* +.. _rcparam_font_weight: + font.weight: ``'normal'`` *no description* +.. _rcparam_font_stretch: + font.stretch: ``'normal'`` *no description* +.. _rcparam_font_size: + font.size: ``10.0`` *no description* +.. _rcparam_font_serif: + font.serif: ``['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']`` *no description* +.. _rcparam_font_sans-serif: + font.sans-serif: ``['DejaVu Sans', 'Bitstream Vera Sans', 'Computer Modern Sans Serif', 'Lucida Grande', 'Verdana', 'Geneva', 'Lucid', 'Arial', 'Helvetica', 'Avant Garde', 'sans-serif']`` *no description* +.. _rcparam_font_cursive: + font.cursive: ``['Apple Chancery', 'Textile', 'Zapf Chancery', 'Sand', 'Script MT', 'Felipa', 'Comic Neue', 'Comic Sans MS', 'cursive']`` *no description* +.. _rcparam_font_fantasy: + font.fantasy: ``['Chicago', 'Charcoal', 'Impact', 'Western', 'xkcd script', 'fantasy']`` *no description* +.. _rcparam_font_monospace: + font.monospace: ``['DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Computer Modern Typewriter', 'Andale Mono', 'Nimbus Mono L', 'Courier New', 'Courier', 'Fixed', 'Terminal', 'monospace']`` *no description* +.. _rcparam_font_enable_last_resort: + font.enable_last_resort: ``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. +.. _rcparam_text_color: + text.color: ``'black'`` *no description* +.. _rcparam_text_hinting: + text.hinting: ``'force_autohint'`` 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.) +.. _rcparam_text_hinting_factor: + text.hinting_factor: ``8`` Specifies the amount of softness for hinting in the horizontal direction. A value of 1 will hint to full pixels. A value of 2 will hint to half pixels etc. +.. _rcparam_text_kerning_factor: + text.kerning_factor: ``0`` 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. +.. _rcparam_text_antialiased: + text.antialiased: ``True`` If True (default), the text will be antialiased. This only affects raster outputs. +.. _rcparam_text_parse_math: + text.parse_math: ``True`` Use mathtext if there is an even number of unescaped dollar signs. +.. _rcparam_text_usetex: + text.usetex: ``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 +.. _rcparam_text_latex_preamble: + text.latex.preamble: ``''`` 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. +.. _rcparam_mathtext_fontset: + mathtext.fontset: ``'dejavusans'`` Should be 'dejavusans' (default), 'dejavuserif', 'cm' (Computer Modern), 'stix', 'stixsans' or 'custom' +.. _rcparam_mathtext_bf: + mathtext.bf: ``'sans:bold'`` *no description* +.. _rcparam_mathtext_bfit: + mathtext.bfit: ``'sans:italic:bold'`` *no description* +.. _rcparam_mathtext_cal: + mathtext.cal: ``'cursive'`` *no description* +.. _rcparam_mathtext_it: + mathtext.it: ``'sans:italic'`` *no description* +.. _rcparam_mathtext_rm: + mathtext.rm: ``'sans'`` *no description* +.. _rcparam_mathtext_sf: + mathtext.sf: ``'sans'`` *no description* +.. _rcparam_mathtext_tt: + mathtext.tt: ``'monospace'`` *no description* +.. _rcparam_mathtext_fallback: + mathtext.fallback: ``'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. +.. _rcparam_mathtext_default: + mathtext.default: ``'it'`` The default font to use for math. Can be any of the LaTeX font names, including the special name "regular" for the same font used in regular text. +.. _rcparam_axes_facecolor: + axes.facecolor: ``'white'`` axes background color +.. _rcparam_axes_edgecolor: + axes.edgecolor: ``'black'`` axes edge color +.. _rcparam_axes_linewidth: + axes.linewidth: ``0.8`` edge line width +.. _rcparam_axes_grid: + axes.grid: ``False`` display grid or not +.. _rcparam_axes_grid_axis: + axes.grid.axis: ``'both'`` which axis the grid should apply to +.. _rcparam_axes_grid_which: + axes.grid.which: ``'major'`` grid lines at {major, minor, both} ticks +.. _rcparam_axes_titlelocation: + axes.titlelocation: ``'center'`` alignment of the title: {left, right, center} +.. _rcparam_axes_titlesize: + axes.titlesize: ``'large'`` font size of the axes title +.. _rcparam_axes_titleweight: + axes.titleweight: ``'normal'`` font weight of title +.. _rcparam_axes_titlecolor: + axes.titlecolor: ``'auto'`` color of the axes title, auto falls back to text.color as default value +.. _rcparam_axes_titley: + axes.titley: ``None`` position title (axes relative units). None implies auto +.. _rcparam_axes_titlepad: + axes.titlepad: ``6.0`` pad between axes and title in points +.. _rcparam_axes_labelsize: + axes.labelsize: ``'medium'`` font size of the x and y labels +.. _rcparam_axes_labelpad: + axes.labelpad: ``4.0`` space between label and axis +.. _rcparam_axes_labelweight: + axes.labelweight: ``'normal'`` weight of the x and y labels +.. _rcparam_axes_labelcolor: + axes.labelcolor: ``'black'`` *no description* +.. _rcparam_axes_axisbelow: + axes.axisbelow: ``'line'`` draw axis gridlines and ticks: - below patches (True) - above patches but below lines ('line') - above all (False) +.. _rcparam_axes_formatter_limits: + axes.formatter.limits: ``[-5, 6]`` use scientific notation if log10 of the axis range is smaller than the first or larger than the second +.. _rcparam_axes_formatter_use_locale: + axes.formatter.use_locale: ``False`` When True, format tick labels according to the user's locale. For example, use ',' as a decimal separator in the fr_FR locale. +.. _rcparam_axes_formatter_use_mathtext: + axes.formatter.use_mathtext: ``False`` When True, use mathtext for scientific notation. +.. _rcparam_axes_formatter_min_exponent: + axes.formatter.min_exponent: ``0`` minimum exponent to format in scientific notation +.. _rcparam_axes_formatter_useoffset: + axes.formatter.useoffset: ``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. +.. _rcparam_axes_formatter_offset_threshold: + axes.formatter.offset_threshold: ``4`` When useoffset is True, the offset will be used when it can remove at least this number of significant digits from tick labels. +.. _rcparam_axes_spines_left: + axes.spines.left: ``True`` display axis spines +.. _rcparam_axes_spines_bottom: + axes.spines.bottom: ``True`` *no description* +.. _rcparam_axes_spines_top: + axes.spines.top: ``True`` *no description* +.. _rcparam_axes_spines_right: + axes.spines.right: ``True`` *no description* +.. _rcparam_axes_unicode_minus: + axes.unicode_minus: ``True`` use Unicode for the minus symbol rather than hyphen. See https://en.wikipedia.org/wiki/Plus_and_minus_signs#Character_codes +.. _rcparam_axes_prop_cycle: + axes.prop_cycle: ``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)])`` *no description* +.. _rcparam_axes_xmargin: + axes.xmargin: ``0.05`` x margin. See `~.axes.Axes.margins` +.. _rcparam_axes_ymargin: + axes.ymargin: ``0.05`` y margin. See `~.axes.Axes.margins` +.. _rcparam_axes_zmargin: + axes.zmargin: ``0.05`` z margin. See `~.axes.Axes.margins` +.. _rcparam_axes_autolimit_mode: + axes.autolimit_mode: ``'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. +.. _rcparam_polaraxes_grid: + polaraxes.grid: ``True`` display grid on polar axes +.. _rcparam_axes3d_grid: + axes3d.grid: ``True`` display grid on 3D axes +.. _rcparam_axes3d_automargin: + axes3d.automargin: ``False`` automatically add margin when manually setting 3D axis limits +.. _rcparam_axes3d_xaxis_panecolor: + axes3d.xaxis.panecolor: ``(0.95, 0.95, 0.95, 0.5)`` background pane on 3D axes +.. _rcparam_axes3d_yaxis_panecolor: + axes3d.yaxis.panecolor: ``(0.9, 0.9, 0.9, 0.5)`` background pane on 3D axes +.. _rcparam_axes3d_zaxis_panecolor: + axes3d.zaxis.panecolor: ``(0.925, 0.925, 0.925, 0.5)`` background pane on 3D axes +.. _rcparam_axes3d_depthshade: + axes3d.depthshade: ``True`` depth shade for 3D scatter plots +.. _rcparam_axes3d_depthshade_minalpha: + axes3d.depthshade_minalpha: ``0.3`` minimum alpha value for depth shading +.. _rcparam_axes3d_mouserotationstyle: + axes3d.mouserotationstyle: ``'arcball'`` {azel, trackball, sphere, arcball} See also https://matplotlib.org/stable/api/toolkits/mplot3d/view_angles.html#rotation-with-mouse +.. _rcparam_axes3d_trackballsize: + axes3d.trackballsize: ``0.667`` trackball diameter, in units of the Axes bbox +.. _rcparam_axes3d_trackballborder: + axes3d.trackballborder: ``0.2`` trackball border width, in units of the Axes bbox (only for 'sphere' and 'arcball' style) +.. _rcparam_xaxis_labellocation: + xaxis.labellocation: ``'center'`` alignment of the xaxis label: {left, right, center} +.. _rcparam_yaxis_labellocation: + yaxis.labellocation: ``'center'`` alignment of the yaxis label: {bottom, top, center} +.. _rcparam_date_autoformatter_year: + date.autoformatter.year: ``'%Y'`` *no description* +.. _rcparam_date_autoformatter_month: + date.autoformatter.month: ``'%Y-%m'`` *no description* +.. _rcparam_date_autoformatter_day: + date.autoformatter.day: ``'%Y-%m-%d'`` *no description* +.. _rcparam_date_autoformatter_hour: + date.autoformatter.hour: ``'%m-%d %H'`` *no description* +.. _rcparam_date_autoformatter_minute: + date.autoformatter.minute: ``'%d %H:%M'`` *no description* +.. _rcparam_date_autoformatter_second: + date.autoformatter.second: ``'%H:%M:%S'`` *no description* +.. _rcparam_date_autoformatter_microsecond: + date.autoformatter.microsecond: ``'%M:%S.%f'`` *no description* +.. _rcparam_date_epoch: + date.epoch: ``'1970-01-01T00:00:00'`` The reference date for Matplotlib's internal date representation. See https://matplotlib.org/stable/gallery/ticks/date_precision_and_epochs.html +.. _rcparam_date_converter: + date.converter: ``'auto'`` 'auto', 'concise' +.. _rcparam_date_interval_multiples: + date.interval_multiples: ``True`` For auto converter whether to use interval_multiples +.. _rcparam_xtick_top: + xtick.top: ``False`` draw ticks on the top side +.. _rcparam_xtick_bottom: + xtick.bottom: ``True`` draw ticks on the bottom side +.. _rcparam_xtick_labeltop: + xtick.labeltop: ``False`` draw label on the top +.. _rcparam_xtick_labelbottom: + xtick.labelbottom: ``True`` draw label on the bottom +.. _rcparam_xtick_major_size: + xtick.major.size: ``3.5`` major tick size in points +.. _rcparam_xtick_minor_size: + xtick.minor.size: ``2.0`` minor tick size in points +.. _rcparam_xtick_major_width: + xtick.major.width: ``0.8`` major tick width in points +.. _rcparam_xtick_minor_width: + xtick.minor.width: ``0.6`` minor tick width in points +.. _rcparam_xtick_major_pad: + xtick.major.pad: ``3.5`` distance to major tick label in points +.. _rcparam_xtick_minor_pad: + xtick.minor.pad: ``3.4`` distance to the minor tick label in points +.. _rcparam_xtick_color: + xtick.color: ``'black'`` color of the ticks +.. _rcparam_xtick_labelcolor: + xtick.labelcolor: ``'inherit'`` color of the tick labels or inherit from xtick.color +.. _rcparam_xtick_labelsize: + xtick.labelsize: ``'medium'`` font size of the tick labels +.. _rcparam_xtick_direction: + xtick.direction: ``'out'`` direction: {in, out, inout} +.. _rcparam_xtick_minor_visible: + xtick.minor.visible: ``False`` visibility of minor ticks on x-axis +.. _rcparam_xtick_major_top: + xtick.major.top: ``True`` draw x axis top major ticks +.. _rcparam_xtick_major_bottom: + xtick.major.bottom: ``True`` draw x axis bottom major ticks +.. _rcparam_xtick_minor_top: + xtick.minor.top: ``True`` draw x axis top minor ticks +.. _rcparam_xtick_minor_bottom: + xtick.minor.bottom: ``True`` draw x axis bottom minor ticks +.. _rcparam_xtick_minor_ndivs: + xtick.minor.ndivs: ``'auto'`` number of minor ticks between the major ticks on x-axis +.. _rcparam_xtick_alignment: + xtick.alignment: ``'center'`` alignment of xticks +.. _rcparam_ytick_left: + ytick.left: ``True`` draw ticks on the left side +.. _rcparam_ytick_right: + ytick.right: ``False`` draw ticks on the right side +.. _rcparam_ytick_labelleft: + ytick.labelleft: ``True`` draw tick labels on the left side +.. _rcparam_ytick_labelright: + ytick.labelright: ``False`` draw tick labels on the right side +.. _rcparam_ytick_major_size: + ytick.major.size: ``3.5`` major tick size in points +.. _rcparam_ytick_minor_size: + ytick.minor.size: ``2.0`` minor tick size in points +.. _rcparam_ytick_major_width: + ytick.major.width: ``0.8`` major tick width in points +.. _rcparam_ytick_minor_width: + ytick.minor.width: ``0.6`` minor tick width in points +.. _rcparam_ytick_major_pad: + ytick.major.pad: ``3.5`` distance to major tick label in points +.. _rcparam_ytick_minor_pad: + ytick.minor.pad: ``3.4`` distance to the minor tick label in points +.. _rcparam_ytick_color: + ytick.color: ``'black'`` color of the ticks +.. _rcparam_ytick_labelcolor: + ytick.labelcolor: ``'inherit'`` color of the tick labels or inherit from ytick.color +.. _rcparam_ytick_labelsize: + ytick.labelsize: ``'medium'`` font size of the tick labels +.. _rcparam_ytick_direction: + ytick.direction: ``'out'`` direction: {in, out, inout} +.. _rcparam_ytick_minor_visible: + ytick.minor.visible: ``False`` visibility of minor ticks on y-axis +.. _rcparam_ytick_major_left: + ytick.major.left: ``True`` draw y axis left major ticks +.. _rcparam_ytick_major_right: + ytick.major.right: ``True`` draw y axis right major ticks +.. _rcparam_ytick_minor_left: + ytick.minor.left: ``True`` draw y axis left minor ticks +.. _rcparam_ytick_minor_right: + ytick.minor.right: ``True`` draw y axis right minor ticks +.. _rcparam_ytick_minor_ndivs: + ytick.minor.ndivs: ``'auto'`` number of minor ticks between the major ticks on y-axis +.. _rcparam_ytick_alignment: + ytick.alignment: ``'center_baseline'`` alignment of yticks +.. _rcparam_grid_color: + grid.color: ``'#b0b0b0'`` b0b0b0" # grid color +.. _rcparam_grid_linestyle: + grid.linestyle: ``'-'`` solid +.. _rcparam_grid_linewidth: + grid.linewidth: ``0.8`` in points +.. _rcparam_grid_alpha: + grid.alpha: ``1.0`` transparency, between 0.0 and 1.0 +.. _rcparam_grid_major_color: + grid.major.color: ``None`` If None defaults to grid.color +.. _rcparam_grid_major_linestyle: + grid.major.linestyle: ``None`` If None defaults to grid.linestyle +.. _rcparam_grid_major_linewidth: + grid.major.linewidth: ``None`` If None defaults to grid.linewidth +.. _rcparam_grid_major_alpha: + grid.major.alpha: ``None`` If None defaults to grid.alpha +.. _rcparam_grid_minor_color: + grid.minor.color: ``None`` If None defaults to grid.color +.. _rcparam_grid_minor_linestyle: + grid.minor.linestyle: ``None`` If None defaults to grid.linestyle +.. _rcparam_grid_minor_linewidth: + grid.minor.linewidth: ``None`` If None defaults to grid.linewidth +.. _rcparam_grid_minor_alpha: + grid.minor.alpha: ``None`` If None defaults to grid.alpha +.. _rcparam_legend_loc: + legend.loc: ``'best'`` *no description* +.. _rcparam_legend_frameon: + legend.frameon: ``True`` if True, draw the legend on a background patch +.. _rcparam_legend_framealpha: + legend.framealpha: ``0.8`` legend patch transparency +.. _rcparam_legend_facecolor: + legend.facecolor: ``'inherit'`` inherit from axes.facecolor; or color spec +.. _rcparam_legend_edgecolor: + legend.edgecolor: ``'0.8'`` background patch boundary color +.. _rcparam_legend_linewidth: + legend.linewidth: ``None`` line width of the legend frame, None means inherit from patch.linewidth +.. _rcparam_legend_fancybox: + legend.fancybox: ``True`` if True, use a rounded box for the legend background, else a rectangle +.. _rcparam_legend_shadow: + legend.shadow: ``False`` if True, give background a shadow effect +.. _rcparam_legend_numpoints: + legend.numpoints: ``1`` the number of marker points in the legend line +.. _rcparam_legend_scatterpoints: + legend.scatterpoints: ``1`` number of scatter points +.. _rcparam_legend_markerscale: + legend.markerscale: ``1.0`` the relative size of legend markers vs. original +.. _rcparam_legend_fontsize: + legend.fontsize: ``'medium'`` *no description* +.. _rcparam_legend_labelcolor: + legend.labelcolor: ``'None'`` *no description* +.. _rcparam_legend_title_fontsize: + legend.title_fontsize: ``None`` None sets to the same as the default axes. +.. _rcparam_legend_borderpad: + legend.borderpad: ``0.4`` border whitespace +.. _rcparam_legend_labelspacing: + legend.labelspacing: ``0.5`` the vertical space between the legend entries +.. _rcparam_legend_handlelength: + legend.handlelength: ``2.0`` the length of the legend lines +.. _rcparam_legend_handleheight: + legend.handleheight: ``0.7`` the height of the legend handle +.. _rcparam_legend_handletextpad: + legend.handletextpad: ``0.8`` the space between the legend line and legend text +.. _rcparam_legend_borderaxespad: + legend.borderaxespad: ``0.5`` the border between the axes and legend edge +.. _rcparam_legend_columnspacing: + legend.columnspacing: ``2.0`` column separation +.. _rcparam_figure_titlesize: + figure.titlesize: ``'large'`` size of the figure title (``Figure.suptitle()``) +.. _rcparam_figure_titleweight: + figure.titleweight: ``'normal'`` weight of the figure title +.. _rcparam_figure_labelsize: + figure.labelsize: ``'large'`` size of the figure label (``Figure.sup[x|y]label()``) +.. _rcparam_figure_labelweight: + figure.labelweight: ``'normal'`` weight of the figure label +.. _rcparam_figure_figsize: + figure.figsize: ``[6.4, 4.8]`` figure size in inches +.. _rcparam_figure_dpi: + figure.dpi: ``100.0`` figure dots per inch +.. _rcparam_figure_facecolor: + figure.facecolor: ``'white'`` figure face color +.. _rcparam_figure_edgecolor: + figure.edgecolor: ``'white'`` figure edge color +.. _rcparam_figure_frameon: + figure.frameon: ``True`` enable figure frame +.. _rcparam_figure_max_open_warning: + figure.max_open_warning: ``20`` The maximum number of figures to open through the pyplot interface before emitting a warning. If less than one this feature is disabled. +.. _rcparam_figure_raise_window: + figure.raise_window: ``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. +.. _rcparam_figure_subplot_left: + figure.subplot.left: ``0.125`` the left side of the subplots of the figure +.. _rcparam_figure_subplot_right: + figure.subplot.right: ``0.9`` the right side of the subplots of the figure +.. _rcparam_figure_subplot_bottom: + figure.subplot.bottom: ``0.11`` the bottom of the subplots of the figure +.. _rcparam_figure_subplot_top: + figure.subplot.top: ``0.88`` the top of the subplots of the figure +.. _rcparam_figure_subplot_wspace: + figure.subplot.wspace: ``0.2`` the amount of width reserved for space between subplots, expressed as a fraction of the average axis width +.. _rcparam_figure_subplot_hspace: + figure.subplot.hspace: ``0.2`` the amount of height reserved for space between subplots, expressed as a fraction of the average axis height +.. _rcparam_figure_autolayout: + figure.autolayout: ``False`` When True, automatically adjust subplot parameters to make the plot fit the figure using `~.Figure.tight_layout` +.. _rcparam_figure_constrained_layout_use: + figure.constrained_layout.use: ``False`` When True, automatically make plot elements fit on the figure. (Not compatible with "figure.autolayout", above). +.. _rcparam_figure_constrained_layout_h_pad: + figure.constrained_layout.h_pad: ``0.04167`` Padding (in inches) around axes; defaults to 3/72 inches, i.e. 3 points +.. _rcparam_figure_constrained_layout_w_pad: + figure.constrained_layout.w_pad: ``0.04167`` Padding (in inches) around axes; defaults to 3/72 inches, i.e. 3 points +.. _rcparam_figure_constrained_layout_hspace: + figure.constrained_layout.hspace: ``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. +.. _rcparam_figure_constrained_layout_wspace: + figure.constrained_layout.wspace: ``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. +.. _rcparam_image_aspect: + image.aspect: ``'equal'`` {equal, auto} or a number +.. _rcparam_image_interpolation: + image.interpolation: ``'auto'`` see help(imshow) for options +.. _rcparam_image_interpolation_stage: + image.interpolation_stage: ``'auto'`` see help(imshow) for options +.. _rcparam_image_cmap: + image.cmap: ``'viridis'`` A colormap name (plasma, magma, etc.) +.. _rcparam_image_lut: + image.lut: ``256`` the size of the colormap lookup table +.. _rcparam_image_origin: + image.origin: ``'upper'`` {lower, upper} +.. _rcparam_image_resample: + image.resample: ``True`` *no description* +.. _rcparam_image_composite_image: + image.composite_image: ``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. +.. _rcparam_contour_negative_linestyle: + contour.negative_linestyle: ``'dashed'`` string or on-off ink sequence +.. _rcparam_contour_corner_mask: + contour.corner_mask: ``True`` {True, False} +.. _rcparam_contour_linewidth: + contour.linewidth: ``None`` {float, None} Size of the contour line widths. If set to None, it falls back to "line.linewidth". +.. _rcparam_contour_algorithm: + contour.algorithm: ``'mpl2014'`` {mpl2005, mpl2014, serial, threaded} +.. _rcparam_errorbar_capsize: + errorbar.capsize: ``0.0`` length of end cap on error bars in pixels +.. _rcparam_hist_bins: + hist.bins: ``10`` The default number of histogram bins or 'auto'. +.. _rcparam_scatter_marker: + scatter.marker: ``'o'`` The default marker type for scatter plots. +.. _rcparam_scatter_edgecolors: + scatter.edgecolors: ``'face'`` The default edge colors for scatter plots. +.. _rcparam_agg_path_chunksize: + agg.path.chunksize: ``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. +.. _rcparam_path_simplify: + path.simplify: ``True`` When True, simplify paths by removing "invisible" points to reduce file size and increase rendering speed +.. _rcparam_path_simplify_threshold: + path.simplify_threshold: ``0.111111111111`` The threshold of similarity below which vertices will be removed in the simplification process. +.. _rcparam_path_snap: + path.snap: ``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. +.. _rcparam_path_sketch: + path.sketch: ``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. +.. _rcparam_path_effects: + path.effects: ``[]`` *no description* +.. _rcparam_savefig_dpi: + savefig.dpi: ``'figure'`` figure dots per inch or 'figure' +.. _rcparam_savefig_facecolor: + savefig.facecolor: ``'auto'`` figure face color when saving +.. _rcparam_savefig_edgecolor: + savefig.edgecolor: ``'auto'`` figure edge color when saving +.. _rcparam_savefig_format: + savefig.format: ``'png'`` {png, ps, pdf, svg} +.. _rcparam_savefig_bbox: + savefig.bbox: ``None`` {tight, standard} 'tight' is incompatible with generating frames for animation +.. _rcparam_savefig_pad_inches: + savefig.pad_inches: ``0.1`` padding to be used, when bbox is set to 'tight' +.. _rcparam_savefig_directory: + savefig.directory: ``'~'`` 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 +.. _rcparam_savefig_transparent: + savefig.transparent: ``False`` whether figures are saved with a transparent background by default +.. _rcparam_savefig_orientation: + savefig.orientation: ``'portrait'`` orientation of saved figure, for PostScript output only +.. _rcparam_macosx_window_mode: + macosx.window_mode: ``'system'`` How to open new figures (system, tab, window) system uses the MacOS system preferences +.. _rcparam_tk_window_focus: + tk.window_focus: ``False`` Maintain shell focus for TkAgg +.. _rcparam_ps_papersize: + ps.papersize: ``'letter'`` {figure, letter, legal, ledger, A0-A10, B0-B10} +.. _rcparam_ps_useafm: + ps.useafm: ``False`` use AFM fonts, results in small files +.. _rcparam_ps_usedistiller: + ps.usedistiller: ``None`` {ghostscript, xpdf, None} Experimental: may produce smaller files. xpdf intended for production of publication quality files, but requires ghostscript, xpdf and ps2eps +.. _rcparam_ps_distiller_res: + ps.distiller.res: ``6000`` dpi +.. _rcparam_ps_fonttype: + ps.fonttype: ``3`` Output Type 3 (Type3) or Type 42 (TrueType) +.. _rcparam_pdf_compression: + pdf.compression: ``6`` integer from 0 to 9 0 disables compression (good for debugging) +.. _rcparam_pdf_fonttype: + pdf.fonttype: ``3`` Output Type 3 (Type3) or Type 42 (TrueType) +.. _rcparam_pdf_use14corefonts: + pdf.use14corefonts: ``False`` *no description* +.. _rcparam_pdf_inheritcolor: + pdf.inheritcolor: ``False`` *no description* +.. _rcparam_svg_image_inline: + svg.image_inline: ``True`` Write raster image data directly into the SVG file +.. _rcparam_svg_fonttype: + svg.fonttype: ``'path'`` How to handle SVG fonts: path: Embed characters as paths -- supported by most SVG renderersnone: Assume fonts are installed on the machine where the SVG will be viewed. +.. _rcparam_svg_hashsalt: + svg.hashsalt: ``None`` If not None, use this string as hash salt instead of uuid4 +.. _rcparam_svg_id: + svg.id: ``None`` If not None, use this string as the value for the `id` attribute in the top tag +.. _rcparam_pgf_rcfonts: + pgf.rcfonts: ``True`` *no description* +.. _rcparam_pgf_preamble: + pgf.preamble: ``''`` See text.latex.preamble for documentation +.. _rcparam_pgf_texsystem: + pgf.texsystem: ``'xelatex'`` *no description* +.. _rcparam_docstring_hardcopy: + docstring.hardcopy: ``False`` set this when you want to generate hardcopy docstring +.. _rcparam_keymap_fullscreen: + keymap.fullscreen: ``['f', 'ctrl+f']`` toggling +.. _rcparam_keymap_home: + keymap.home: ``['h', 'r', 'home']`` home or reset mnemonic +.. _rcparam_keymap_back: + keymap.back: ``['left', 'c', 'backspace', 'MouseButton.BACK']`` forward / backward keys +.. _rcparam_keymap_forward: + keymap.forward: ``['right', 'v', 'MouseButton.FORWARD']`` for quick navigation +.. _rcparam_keymap_pan: + keymap.pan: ``['p']`` pan mnemonic +.. _rcparam_keymap_zoom: + keymap.zoom: ``['o']`` zoom mnemonic +.. _rcparam_keymap_save: + keymap.save: ``['s', 'ctrl+s']`` saving current figure +.. _rcparam_keymap_help: + keymap.help: ``['f1']`` display help about active tools +.. _rcparam_keymap_quit: + keymap.quit: ``['ctrl+w', 'cmd+w', 'q']`` close the current figure +.. _rcparam_keymap_quit_all: + keymap.quit_all: ``[]`` close all figures +.. _rcparam_keymap_grid: + keymap.grid: ``['g']`` switching on/off major grids in current axes +.. _rcparam_keymap_grid_minor: + keymap.grid_minor: ``['G']`` switching on/off minor grids in current axes +.. _rcparam_keymap_yscale: + keymap.yscale: ``['l']`` toggle scaling of y-axes ('log'/'linear') +.. _rcparam_keymap_xscale: + keymap.xscale: ``['k', 'L']`` toggle scaling of x-axes ('log'/'linear') +.. _rcparam_keymap_copy: + keymap.copy: ``['ctrl+c', 'cmd+c']`` copy figure to clipboard +.. _rcparam_animation_html: + animation.html: ``'none'`` How to display the animation as HTML in the IPython notebook: - 'html5' uses HTML5 video tag - 'jshtml' creates a JavaScript animation +.. _rcparam_animation_writer: + animation.writer: ``'ffmpeg'`` MovieWriter 'backend' to use +.. _rcparam_animation_codec: + animation.codec: ``'h264'`` Codec to use for writing movie +.. _rcparam_animation_bitrate: + animation.bitrate: ``-1`` Controls size/quality trade-off for movie. -1 implies let utility auto-determine +.. _rcparam_animation_frame_format: + animation.frame_format: ``'png'`` Controls frame format used by temp files +.. _rcparam_animation_ffmpeg_path: + animation.ffmpeg_path: ``'ffmpeg'`` Path to ffmpeg binary. Unqualified paths are resolved by subprocess.Popen. +.. _rcparam_animation_ffmpeg_args: + animation.ffmpeg_args: ``[]`` Additional arguments to pass to ffmpeg +.. _rcparam_animation_convert_path: + animation.convert_path: ``'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). +.. _rcparam_animation_convert_args: + animation.convert_args: ``['-layers', 'OptimizePlus']`` Additional arguments to pass to convert +.. _rcparam_animation_embed_limit: + animation.embed_limit: ``20.0`` Limit, in MB, of size of base64 encoded animation in HTML (i.e. IPython notebook) +.. _rcparam__internal_classic_mode: + _internal.classic_mode: ``False`` *no description* +.. _rcparam_backend: + backend: ``None`` *no description* diff --git a/lib/matplotlib/rcsetup.py b/lib/matplotlib/rcsetup.py index cbfd8f6afca6..5cd42750d27f 100644 --- a/lib/matplotlib/rcsetup.py +++ b/lib/matplotlib/rcsetup.py @@ -3278,6 +3278,8 @@ def _generate_rst(): # pragma: no cover """ for param in _params: text += f""" +.. _rcparam_{param.name.replace('.', '_')}: + {param.name}: ``{param.default!r}`` {param.description if param.description else "*no description*"} """ From 28841c897ac0ac3bfd911febb0dd3c324e456c35 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Fri, 19 Dec 2025 14:48:21 +0100 Subject: [PATCH 3/3] Fix incorrect rcParams references --- doc/api/next_api_changes/behavior/28437-CH.rst | 2 +- doc/api/prev_api_changes/api_changes_3.10.1.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/next_api_changes/behavior/28437-CH.rst b/doc/api/next_api_changes/behavior/28437-CH.rst index 6121dfec8163..bb303bbe9d3b 100644 --- a/doc/api/next_api_changes/behavior/28437-CH.rst +++ b/doc/api/next_api_changes/behavior/28437-CH.rst @@ -2,7 +2,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When passing and array to ``imshow(..., alpha=...)``, the parameter was silently ignored -if the image data was a RGB or RBGA image or if :rc:`interpolation_state` +if the image data was an RGB or RBGA image or if :rc:`image.interpolation_stage` resolved to "rbga". This is now fixed, and the alpha array overwrites any previous transparency information. diff --git a/doc/api/prev_api_changes/api_changes_3.10.1.rst b/doc/api/prev_api_changes/api_changes_3.10.1.rst index 26d43ddf8b17..71a2f71efc94 100644 --- a/doc/api/prev_api_changes/api_changes_3.10.1.rst +++ b/doc/api/prev_api_changes/api_changes_3.10.1.rst @@ -8,7 +8,7 @@ Behaviour ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When passing and array to ``imshow(..., alpha=...)``, the parameter was silently ignored -if the image data was a RGB or RBGA image or if :rc:`interpolation_state` +if the image data was an RGB or RBGA image or if :rc:`image.interpolation_stage` resolved to "rbga". This is now fixed, and the alpha array overwrites any previous transparency information.