Skip to content

Commit a435d9e

Browse files
committed
Replace "matplotlibrc" by "rcParams" in the docs where applicable.
In preparation for the possible switch to the new rcsystem. This doesn't touch any place actually documenting the rcsystem, just places where "the foo param in the matplotlibrc" can reasonably be replaced by "the foo rcParam". The `examples.download` and `examples.directory` rcParams removed from doc/matplotlibrc have been removed in 6c5e961 (2012). The verbose.level rcParam is deprecated, update the docs accordingly.
1 parent 0d0eb39 commit a435d9e

14 files changed

+47
-70
lines changed

doc/matplotlibrc

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,4 @@
1-
backend : Agg
2-
3-
figure.figsize : 5.5, 4.5 # figure size in inches
4-
savefig.dpi : 80 # figure dots per inch
5-
docstring.hardcopy : True # set this when you want to generate hardcopy docstring
6-
7-
# these parameters are useful for packagers who want to build the docs
8-
# w/o invoking file downloads for the sampledata (see
9-
# matplotlib.cbook.get_sample_data. Unpack
10-
# mpl_sampledata-VERSION.tar.gz and point examples.directory to it.
11-
# You can use a relative path for examples.directory and it must be
12-
# relative to this matplotlibrc file
13-
14-
#examples.download : False # False to bypass downloading mechanism
15-
#examples.directory : /your/path/to/sample_data/ # directory to look in if download is false
16-
1+
backend : Agg
2+
figure.figsize : 5.5, 4.5 # figure size in inches
3+
savefig.dpi : 80 # figure dots per inch
4+
docstring.hardcopy : True # set this when you want to generate hardcopy docstring

examples/api/sankey_basics.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,9 @@
6767
# Notice:
6868
#
6969
# 1. Since the sum of the flows is nonzero, the width of the trunk isn't
70-
# uniform. If verbose.level is helpful (in matplotlibrc), a message is
71-
# given in the terminal window.
72-
# 2. The second flow doesn't appear because its value is zero. Again, if
73-
# verbose.level is helpful, a message is given in the terminal window.
70+
# uniform. The matplotlib logging system logs this at the DEBUG level.
71+
# 2. The second flow doesn't appear because its value is zero. Again, this is
72+
# logged at the DEBUG level.
7473

7574

7675
###############################################################################

examples/api/unicode_minus.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
Unicode minus
44
=============
55
6-
You can use the proper typesetting Unicode minus (see
7-
https://en.wikipedia.org/wiki/Plus_sign#Plus_sign) or the ASCII hyphen
8-
for minus, which some people prefer. The matplotlibrc param
9-
axes.unicode_minus controls the default behavior.
6+
You can use the proper typesetting `Unicode minus`__ or the ASCII hyphen for
7+
minus, which some people prefer. :rc:`axes.unicode_minus` controls the default
8+
behavior.
9+
10+
__ https://en.wikipedia.org/wiki/Plus_and_minus_signs#Character_codes
1011
1112
The default is to use the Unicode minus.
1213
"""
14+
1315
import numpy as np
1416
import matplotlib
1517
import matplotlib.pyplot as plt

examples/ticks_and_spines/tick_xlabel_top.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
(default False) and :rc:`xtick.labelbottom` (default True) and
88
:rc:`xtick.bottom` (default True) to control where on the axes ticks and
99
their labels appear.
10-
These properties can also be set in the ``.matplotlib/matplotlibrc``.
1110
11+
These properties can also be set in the ``.matplotlib/matplotlibrc``.
1212
"""
13+
1314
import matplotlib.pyplot as plt
1415
import numpy as np
1516

lib/matplotlib/axes/_axes.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3369,8 +3369,7 @@ def boxplot(self, x, notch=None, sym=None, vert=None, whis=None,
33693369
33703370
"""
33713371

3372-
# If defined in matplotlibrc, apply the value from rc file
3373-
# Overridden if argument is passed
3372+
# Missing arguments default to rcParam values.
33743373
if whis is None:
33753374
whis = rcParams['boxplot.whiskers']
33763375
if bootstrap is None:

lib/matplotlib/backend_bases.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2454,7 +2454,7 @@ def key_press_handler(event, canvas, toolbar=None):
24542454
if event.key is None:
24552455
return
24562456

2457-
# Load key-mappings from your matplotlibrc file.
2457+
# Load key-mappings from rcParams.
24582458
fullscreen_keys = rcParams['keymap.fullscreen']
24592459
home_keys = rcParams['keymap.home']
24602460
back_keys = rcParams['keymap.back']

lib/matplotlib/backends/backend_agg.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -521,11 +521,10 @@ def print_jpg(self, filename_or_obj, *args, **kwargs):
521521
Other Parameters
522522
----------------
523523
quality : int
524-
The image quality, on a scale from 1 (worst) to
525-
95 (best). The default is 95, if not given in the
526-
matplotlibrc file in the savefig.jpeg_quality parameter.
527-
Values above 95 should be avoided; 100 completely
528-
disables the JPEG quantization stage.
524+
The image quality, on a scale from 1 (worst) to 100 (best).
525+
The default is :rc:`savefig.jpeg_quality`. Values above
526+
95 should be avoided; 100 completely disables the JPEG
527+
quantization stage.
529528
530529
optimize : bool
531530
If present, indicates that the encoder should
@@ -543,7 +542,7 @@ def print_jpg(self, filename_or_obj, *args, **kwargs):
543542
# handle any transparency
544543
image = Image.frombuffer('RGBA', size, buf, 'raw', 'RGBA', 0, 1)
545544
rgba = mcolors.to_rgba(rcParams['savefig.facecolor'])
546-
color = tuple([int(x * 255.0) for x in rgba[:3]])
545+
color = tuple([int(x * 255) for x in rgba[:3]])
547546
background = Image.new('RGB', size, color)
548547
background.paste(image, image)
549548
options = {k: kwargs[k]

lib/matplotlib/contour.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1743,19 +1743,17 @@ def _initialize_x_y(self, z):
17431743
contour-only keyword arguments:
17441744
17451745
*linewidths*: [ *None* | number | tuple of numbers ]
1746-
If *linewidths* is *None*, the default width in
1747-
``lines.linewidth`` in ``matplotlibrc`` is used.
1746+
If *None*, defaults to :rc:`lines.linewidth`.
17481747
17491748
If a number, all levels will be plotted with this linewidth.
17501749
17511750
If a tuple, different levels will be plotted with different
17521751
linewidths in the order specified.
17531752
17541753
*linestyles*: [ *None* | 'solid' | 'dashed' | 'dashdot' | 'dotted' ]
1755-
If *linestyles* is *None*, the default is 'solid' unless
1756-
the lines are monochrome. In that case, negative
1757-
contours will take their linestyle from the ``matplotlibrc``
1758-
``contour.negative_linestyle`` setting.
1754+
If *linestyles* is *None*, the default is 'solid' unless the lines
1755+
are monochrome. In that case, negative contours will take their
1756+
linestyle from :rc:`contour.negative_linestyle` setting.
17591757
17601758
*linestyles* can also be an iterable of the above strings
17611759
specifying a set of linestyles to be used. If this

lib/matplotlib/figure.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1809,28 +1809,28 @@ def savefig(self, fname, **kwargs):
18091809
18101810
If *format* is *None* and *fname* is a string, the output
18111811
format is deduced from the extension of the filename. If
1812-
the filename has no extension, the value of the rc parameter
1813-
``savefig.format`` is used.
1812+
the filename has no extension, :rc:`savefig.format` is used.
18141813
18151814
If *fname* is not a string, remember to specify *format* to
18161815
ensure that the correct backend is used.
18171816
18181817
Other Parameters
18191818
----------------
18201819
1821-
dpi : [ *None* | scalar > 0 | 'figure']
1822-
The resolution in dots per inch. If *None* it will default to
1823-
the value ``savefig.dpi`` in the matplotlibrc file. If 'figure'
1824-
it will set the dpi to be the value of the figure.
1820+
dpi : [ *None* | scalar > 0 | 'figure' ]
1821+
The resolution in dots per inch. If *None*, defaults to
1822+
:rc:`savefig.dpi`. If 'figure', uses the figure's dpi value.
18251823
18261824
facecolor : color spec or None, optional
1827-
the facecolor of the figure; if None, defaults to savefig.facecolor
1825+
The facecolor of the figure; if *None*, defaults to
1826+
:rc:`savefig.facecolor`.
18281827
18291828
edgecolor : color spec or None, optional
1830-
the edgecolor of the figure; if None, defaults to savefig.edgecolor
1829+
The edgecolor of the figure; if *None*, defaults to
1830+
:rc:`savefig.edgecolor`
18311831
18321832
orientation : {'landscape', 'portrait'}
1833-
not supported on all backends; currently only on postscript output
1833+
Currently only supported by the postscript backend.
18341834
18351835
papertype : str
18361836
One of 'letter', 'legal', 'executive', 'ledger', 'a0' through

lib/matplotlib/font_manager.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ class FontProperties(object):
556556
The items may include a generic font family name, either
557557
'serif', 'sans-serif', 'cursive', 'fantasy', or 'monospace'.
558558
In that case, the actual font to be used will be looked up
559-
from the associated rcParam in :file:`matplotlibrc`.
559+
from the associated rcParam.
560560
561561
- style: Either 'normal', 'italic' or 'oblique'.
562562
@@ -577,7 +577,7 @@ class FontProperties(object):
577577
absolute font size, e.g., 12
578578
579579
The default font property for TrueType fonts (as specified in the
580-
default :file:`matplotlibrc` file) is::
580+
default rcParams) is::
581581
582582
sans-serif, normal, normal, normal, normal, scalable.
583583
@@ -596,9 +596,9 @@ class FontProperties(object):
596596
This support does not require fontconfig to be installed. We are merely
597597
borrowing its pattern syntax for use here.
598598
599-
Note that matplotlib's internal font manager and fontconfig use a
599+
Note that Matplotlib's internal font manager and fontconfig use a
600600
different algorithm to lookup fonts, so the results of the same pattern
601-
may be different in matplotlib than in other applications that use
601+
may be different in Matplotlib than in other applications that use
602602
fontconfig.
603603
"""
604604

lib/matplotlib/pyplot.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,8 +467,7 @@ def figure(num=None, # autoincrement if None, else integer from 1-N
467467
to properly clean up the memory.
468468
469469
rcParams defines the default values, which can be modified in the
470-
matplotlibrc file
471-
470+
matplotlibrc file.
472471
"""
473472

474473
if figsize is None:

lib/matplotlib/texmanager.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,7 @@
2525
Z = texmanager.get_rgba(s, fontsize=12, dpi=80, rgb=(1,0,0))
2626
2727
To enable tex rendering of all text in your matplotlib figure, set
28-
text.usetex in your matplotlibrc file or include these two lines in
29-
your script::
30-
31-
from matplotlib import rc
32-
rc('text', usetex=True)
33-
28+
:rc:`text.usetex` to True.
3429
"""
3530

3631
import copy

lib/matplotlib/text.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -969,11 +969,10 @@ def set_linespacing(self, spacing):
969969

970970
def set_family(self, fontname):
971971
"""
972-
Set the font family. May be either a single string, or a list
973-
of strings in decreasing priority. Each string may be either
974-
a real font name or a generic font class name. If the latter,
975-
the specific font names will be looked up in the
976-
:file:`matplotlibrc` file.
972+
Set the font family. May be either a single string, or a list of
973+
strings in decreasing priority. Each string may be either a real font
974+
name or a generic font class name. If the latter, the specific font
975+
names will be looked up in the corresponding rcParams.
977976
978977
ACCEPTS: [FONTNAME | 'serif' | 'sans-serif' | 'cursive' | 'fantasy' |
979978
'monospace' ]

lib/matplotlib/tri/tricontour.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,7 @@ def tricontour(ax, *args, **kwargs):
230230
tricontour-only keyword arguments:
231231
232232
*linewidths*: [ *None* | number | tuple of numbers ]
233-
If *linewidths* is *None*, the default width in
234-
``lines.linewidth`` in ``matplotlibrc`` is used.
233+
If *linewidths* is *None*, defaults to rc:`lines.linewidth`.
235234
236235
If a number, all levels will be plotted with this linewidth.
237236
@@ -248,8 +247,7 @@ def tricontour(ax, *args, **kwargs):
248247
249248
If contour is using a monochrome colormap and the contour
250249
level is less than 0, then the linestyle specified
251-
in ``contour.negative_linestyle`` in ``matplotlibrc``
252-
will be used.
250+
in :rc:`contour.negative_linestyle` will be used.
253251
254252
tricontourf-only keyword arguments:
255253

0 commit comments

Comments
 (0)