Skip to content

Commit 3599db9

Browse files
authored
Merge pull request #10898 from anntzer/mplrc
Replace "matplotlibrc" by "rcParams" in the docs where applicable.
2 parents 9663522 + aa71657 commit 3599db9

File tree

14 files changed

+47
-70
lines changed

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 ``.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
@@ -3319,8 +3319,7 @@ def boxplot(self, x, notch=None, sym=None, vert=None, whis=None,
33193319
33203320
"""
33213321

3322-
# If defined in matplotlibrc, apply the value from rc file
3323-
# Overridden if argument is passed
3322+
# Missing arguments default to rcParams.
33243323
if whis is None:
33253324
whis = rcParams['boxplot.whiskers']
33263325
if bootstrap is None:

lib/matplotlib/backend_bases.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2432,7 +2432,7 @@ def key_press_handler(event, canvas, toolbar=None):
24322432
if event.key is None:
24332433
return
24342434

2435-
# Load key-mappings from your matplotlibrc file.
2435+
# Load key-mappings from rcParams.
24362436
fullscreen_keys = rcParams['keymap.fullscreen']
24372437
home_keys = rcParams['keymap.home']
24382438
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
@@ -1749,19 +1749,17 @@ def _initialize_x_y(self, z):
17491749
contour-only keyword arguments:
17501750
17511751
*linewidths*: [ *None* | number | tuple of numbers ]
1752-
If *linewidths* is *None*, the default width in
1753-
``lines.linewidth`` in ``matplotlibrc`` is used.
1752+
If *None*, defaults to :rc:`lines.linewidth`.
17541753
17551754
If a number, all levels will be plotted with this linewidth.
17561755
17571756
If a tuple, different levels will be plotted with different
17581757
linewidths in the order specified.
17591758
17601759
*linestyles*: [ *None* | 'solid' | 'dashed' | 'dashdot' | 'dotted' ]
1761-
If *linestyles* is *None*, the default is 'solid' unless
1762-
the lines are monochrome. In that case, negative
1763-
contours will take their linestyle from the ``matplotlibrc``
1764-
``contour.negative_linestyle`` setting.
1760+
If *linestyles* is *None*, the default is 'solid' unless the lines
1761+
are monochrome. In that case, negative contours will take their
1762+
linestyle from :rc:`contour.negative_linestyle` setting.
17651763
17661764
*linestyles* can also be an iterable of the above strings
17671765
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
@@ -1782,28 +1782,28 @@ def savefig(self, fname, **kwargs):
17821782
17831783
If *format* is *None* and *fname* is a string, the output
17841784
format is deduced from the extension of the filename. If
1785-
the filename has no extension, the value of the rc parameter
1786-
``savefig.format`` is used.
1785+
the filename has no extension, :rc:`savefig.format` is used.
17871786
17881787
If *fname* is not a string, remember to specify *format* to
17891788
ensure that the correct backend is used.
17901789
17911790
Other Parameters
17921791
----------------
17931792
1794-
dpi : [ *None* | scalar > 0 | 'figure']
1795-
The resolution in dots per inch. If *None* it will default to
1796-
the value ``savefig.dpi`` in the matplotlibrc file. If 'figure'
1797-
it will set the dpi to be the value of the figure.
1793+
dpi : [ *None* | scalar > 0 | 'figure' ]
1794+
The resolution in dots per inch. If *None*, defaults to
1795+
:rc:`savefig.dpi`. If 'figure', uses the figure's dpi value.
17981796
17991797
facecolor : color spec or None, optional
1800-
the facecolor of the figure; if None, defaults to savefig.facecolor
1798+
The facecolor of the figure; if *None*, defaults to
1799+
:rc:`savefig.facecolor`.
18011800
18021801
edgecolor : color spec or None, optional
1803-
the edgecolor of the figure; if None, defaults to savefig.edgecolor
1802+
The edgecolor of the figure; if *None*, defaults to
1803+
:rc:`savefig.edgecolor`
18041804
18051805
orientation : {'landscape', 'portrait'}
1806-
not supported on all backends; currently only on postscript output
1806+
Currently only supported by the postscript backend.
18071807
18081808
papertype : str
18091809
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)