Skip to content

Commit 6bf26c6

Browse files
committed
Merge remote-tracking branch 'matplotlib/v2.2.2-doc' into v2.2.x
2 parents d91aa31 + b78f64f commit 6bf26c6

File tree

77 files changed

+1707
-558
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+1707
-558
lines changed

.circleci/config.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ fonts-run: &fonts-install
4747
echo "Not downloading Humor-Sans; file already exists."
4848
fi
4949
fc-cache -f -v
50+
save_cache:
51+
key: fonts-1
52+
paths:
53+
- ~/.local/share/fonts/
54+
restore_cache:
55+
key: fonts-1
5056

5157
pip-run: &pip-install
5258
# Upgrade pip and setuptools and wheel to get as clean an install as possible

README.rst

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
|Travis|_ |AppVeyor|_ |Codecov|_ |PyPi|_ |Gitter|_ |Depsy|_
1+
|Travis|_ |AppVeyor|_ |Codecov|_ |PyPi|_ |Gitter|_ |NUMFocus|_
22

33

44
.. |Travis| image:: https://travis-ci.org/matplotlib/matplotlib.svg?branch=master
@@ -13,11 +13,8 @@
1313
.. |PyPi| image:: https://badge.fury.io/py/matplotlib.svg
1414
.. _PyPi: https://badge.fury.io/py/matplotlib
1515

16-
.. |Gitter| image:: https://img.shields.io/gitter/room/nwjs/nw.js.svg
17-
:target: https://gitter.im/matplotlib/matplotlib?utm_source=share-link&utm_medium=link&utm_campaign=share-link
18-
19-
.. |Depsy| image:: http://depsy.org/api/package/pypi/matplotlib/badge.svg
20-
.. _Depsy: http://depsy.org/package/python/matplotlib
16+
.. |Gitter| image:: https://badges.gitter.im/matplotlib/matplotlib.png
17+
.. _Gitter: https://gitter.im/matplotlib/matplotlib
2118

2219
.. |NUMFocus| image:: https://img.shields.io/badge/powered%20by-NumFOCUS-orange.svg?style=flat&colorA=E1523D&colorB=007D8A
2320
.. _NUMFocus: http://www.numfocus.org
@@ -70,7 +67,8 @@ matplotlib's communication channels include active mailing lists:
7067

7168
The first is a good starting point for general questions and discussions.
7269

73-
`Gitter <https://gitter.im/matplotlib/matplotlib>`_ is for coordinating development and asking questions directly related to contributing to matplotlib.
70+
Gitter_ is for coordinating development and asking questions directly related
71+
to contributing to matplotlib.
7472

7573
Contribute
7674
==========

doc/_static/brokenaxes.png

17 KB
Loading

doc/_static/mpl.css

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -772,24 +772,6 @@ figcaption {
772772
}
773773

774774

775-
/* "Summer Fellowship" message. */
776-
#plotting-contest {
777-
background: #EE9816;
778-
box-sizing: border-box;
779-
color: #fffa;
780-
font-weight: bold;
781-
left: 0;
782-
min-height: 3em;
783-
padding: 0.5em;
784-
top: 0;
785-
width: 100%;
786-
z-index: 10000;
787-
}
788-
789-
#plotting-contest a {
790-
color: #fff;
791-
text-decoration:underline;
792-
}
793775

794776
/* "Go to released version" message. */
795777
#unreleased-message {

doc/_templates/layout.html

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,7 @@ <h3>{{ _('Navigation') }}</h3>
172172
</a>
173173
</div>
174174
{%- endif %}
175-
<div id="plotting-contest">
176-
The 2018 <a href="https://www.eiseverywhere.com/ehome/index.php?eventid=299527&tabid=648119">
177-
SciPy John Hunter Excellence in Plotting Contest </a> is accepting
178-
<a href="https://docs.google.com/forms/d/e/1FAIpQLSdpr5RxQcoXqF768vFcUi5G3R5q8u_k_tgdNanChqerr-2YIw/viewform">
179-
submissions until June 8th!
180-
</a>
181-
</div>
175+
182176
<div style="background-color: white; text-align: left; padding: 10px 10px 15px 15px; position: relative;">
183177
{%- if builder in ('htmlhelp', 'devhelp', 'latex') %}
184178
<a href="{{ pathto('index') }}">

doc/conf.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,6 @@ def _check_deps():
251251
# using the given strftime format.
252252
html_last_updated_fmt = '%b %d, %Y'
253253

254-
# If true, SmartyPants will be used to convert quotes and dashes to
255-
# typographically correct entities.
256-
#html_use_smartypants = True
257-
258254
# Content template for the index page.
259255
html_index = 'index.html'
260256

@@ -283,6 +279,9 @@ def _check_deps():
283279
# Output file base name for HTML help builder.
284280
htmlhelp_basename = 'Matplotlibdoc'
285281

282+
# Use typographic quote characters.
283+
smartquotes = False
284+
286285
# Path to favicon
287286
html_favicon = '_static/favicon.ico'
288287

doc/devel/coding_guide.rst

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -41,47 +41,59 @@ Documentation
4141
PR Review guidelines
4242
====================
4343

44+
* Be patient and `kind <https://youtu.be/tzFWz5fiVKU?t=49m30s>`__ with
45+
contributors.
46+
4447
* If you have commit rights, then you are trusted to use them. Please
4548
help review and merge PRs!
4649

47-
* For code changes (anything in ``src`` or ``lib``) two developers
48-
(those with commit rights) should review all pull requests. If you
49-
are the first to review a PR and approve of the changes use the
50-
github `'approve review'
50+
* Documentation and examples may be merged by the first reviewer. Use
51+
the threshold "is this better than it was?" as the review criteria.
52+
53+
* For code changes (anything in ``src`` or ``lib``) at least two
54+
developers (those with commit rights) should review all pull
55+
requests. If you are the first to review a PR and approve of the
56+
changes use the github `'approve review'
5157
<https://help.github.com/articles/reviewing-changes-in-pull-requests/>`__
52-
tool to mark it as such. If you are a subsequent reviewer and you
53-
approve, either merge (and backport if needed) or select ``'approve
54-
review'``.
58+
tool to mark it as such. If you are a subsequent reviewer please
59+
approve the review and if you think no more review is needed, merge
60+
the PR.
5561

5662
Ensure that all API changes are documented in
5763
:file:`doc/api/api_changes` and significant new features have and
5864
entry in :file:`doc/user/whats_new`.
5965

60-
* Documentation and examples may be merged by the first reviewer. Use
61-
the threshold "is this better than it was?" as the review criteria.
62-
63-
* Make sure the Travis, Appvyor, and codecov tests are passing before
64-
merging.
66+
* Make sure the Travis, Appvyor, circle, and codecov tests are passing
67+
before merging.
6568

6669
- Whenever a pull request is created or updated, Travis and Appveyor
6770
automatically runs the test suite on all versions of Python
6871
supported by Matplotlib. The `tox` support in Matplotlib may be
6972
useful for testing locally.
7073

71-
* Do not self merge, except for 'small' patches to un-break the CI.
74+
* Do not self merge, except for 'small' patches to un-break the CI or
75+
when another reviewer explicitly allows it (ex, "Approve modulo CI
76+
passing, may self merge when green")
7277

7378
* Squashing is case-by-case. The balance is between burden on the
7479
contributor, keeping a relatively clean history, and keeping a
7580
history usable for bisecting. The only time we are really strict
7681
about it is to eliminate binary files (ex multiple test image
7782
re-generations) and to remove upstream merges.
7883

79-
* Be patient with contributors.
80-
8184
* Do not let perfect be the enemy of the good, particularly for
8285
documentation or example PRs. If you find yourself making many
83-
small suggestions, either open a PR against the original branch or
84-
merge the PR and then open a new PR against upstream.
86+
small suggestions, either open a PR against the original branch,
87+
push changes to the contributor branch, or merge the PR and then
88+
open a new PR against upstream.
89+
90+
* If you push to a contributor branch leave a comment explaining what
91+
you did, ex "I took the liberty of pushing a small clean-up PR to
92+
your branch, thanks for your work.". If you are going to make
93+
substantial changes to the code or intent of the PR please check
94+
with the contributor first.
95+
96+
8597

8698

8799
Branches and Backports

doc/thirdpartypackages/index.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,13 @@ make up the plot.
7171
Specialty plots
7272
***************
7373

74+
Broken Axes
75+
===========
76+
`brokenaxes <https://github.com/bendichter/brokenaxes>`_ supplies an axes
77+
class that can have a visual break to indicate a discontinuous range.
78+
79+
.. image:: /_static/brokenaxes.png
80+
7481
DeCiDa
7582
======
7683

@@ -153,6 +160,7 @@ Windrose
153160
Numpy library to manage wind data, draw windroses (also known as polar rose
154161
plots), draw probability density functions and fit Weibull distributions.
155162

163+
156164
Interactivity
157165
*************
158166

examples/color/color_by_yvalue.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,17 @@
2222
fig, ax = plt.subplots()
2323
ax.plot(t, smiddle, t, slower, t, supper)
2424
plt.show()
25+
26+
#############################################################################
27+
#
28+
# ------------
29+
#
30+
# References
31+
# """"""""""
32+
#
33+
# The use of the following functions, methods, classes and modules is shown
34+
# in this example:
35+
36+
import matplotlib
37+
matplotlib.axes.Axes.plot
38+
matplotlib.pyplot.plot

examples/color/color_cycle_default.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
Colors in the default property cycle
44
====================================
55
6-
Display the colors from the default prop_cycle.
6+
Display the colors from the default prop_cycle, which is obtained from the
7+
:ref:`rc parameters<sphx_glr_tutorials_introductory_customizing.py>`.
78
"""
89
import numpy as np
910
import matplotlib.pyplot as plt
@@ -38,3 +39,21 @@
3839
fig.suptitle('Colors in the default prop_cycle', fontsize='large')
3940

4041
plt.show()
42+
43+
#############################################################################
44+
#
45+
# ------------
46+
#
47+
# References
48+
# """"""""""
49+
#
50+
# The use of the following functions, methods, classes and modules is shown
51+
# in this example:
52+
53+
import matplotlib
54+
matplotlib.axes.Axes.axhline
55+
matplotlib.axes.Axes.axvline
56+
matplotlib.pyplot.axhline
57+
matplotlib.pyplot.axvline
58+
matplotlib.axes.Axes.set_facecolor
59+
matplotlib.figure.Figure.suptitle

examples/color/color_cycler.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
99
This example demonstrates two different APIs:
1010
11-
1. Setting the default rc parameter specifying the property cycle.
12-
This affects all subsequent axes (but not axes already created).
11+
1. Setting the default
12+
:ref:`rc parameter<sphx_glr_tutorials_introductory_customizing.py>`
13+
specifying the property cycle. This affects all subsequent axes
14+
(but not axes already created).
1315
2. Setting the property cycle for a single pair of axes.
1416
"""
1517
from cycler import cycler
@@ -43,3 +45,17 @@
4345
# Tweak spacing between subplots to prevent labels from overlapping
4446
fig.subplots_adjust(hspace=0.3)
4547
plt.show()
48+
49+
#############################################################################
50+
#
51+
# ------------
52+
#
53+
# References
54+
# """"""""""
55+
#
56+
# The use of the following functions, methods, classes and modules is shown
57+
# in this example:
58+
59+
import matplotlib
60+
matplotlib.axes.Axes.plot
61+
matplotlib.axes.Axes.set_prop_cycle

examples/color/color_demo.py

Lines changed: 61 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,75 @@
33
Color Demo
44
==========
55
6-
matplotlib gives you 5 ways to specify colors,
6+
Matplotlib gives you 8 ways to specify colors,
77
8-
1) as a single letter string, ala MATLAB
8+
1) an RGB or RGBA tuple of float values in ``[0, 1]`` (e.g. ``(0.1, 0.2, 0.5)``
9+
or ``(0.1, 0.2, 0.5, 0.3)``). RGBA is short for Red, Green, Blue, Alpha;
10+
2) a hex RGB or RGBA string (e.g., ``'#0F0F0F'`` or ``'#0F0F0F0F'``);
11+
3) a string representation of a float value in ``[0, 1]`` inclusive for gray
12+
level (e.g., ``'0.5'``);
13+
4) a single letter string, i.e. one of
14+
``{'b', 'g', 'r', 'c', 'm', 'y', 'k', 'w'}``;
15+
5) a X11/CSS4 ("html") color name, e.g. ``"blue"``;
16+
6) a name from the `xkcd color survey <https://xkcd.com/color/rgb/>`__,
17+
prefixed with ``'xkcd:'`` (e.g., ``'xkcd:sky blue'``);
18+
7) a "Cn" color spec, i.e. `'C'` followed by a single digit, which is an index
19+
into the default property cycle
20+
(``matplotlib.rcParams['axes.prop_cycle']``); the indexing occurs at artist
21+
creation time and defaults to black if the cycle does not include color.
22+
8) one of ``{'tab:blue', 'tab:orange', 'tab:green',
23+
'tab:red', 'tab:purple', 'tab:brown', 'tab:pink',
24+
'tab:gray', 'tab:olive', 'tab:cyan'}`` which are the Tableau Colors from the
25+
'tab10' categorical palette (which is the default color cycle);
926
10-
2) as an html style hex string or html color name
27+
For more information on colors in matplotlib see
1128
12-
3) as an R,G,B tuple, where R,G,B, range from 0-1
13-
14-
4) as a string representing a floating point number
15-
from 0 to 1, corresponding to shades of gray.
16-
17-
5) as a special color "Cn", where n is a number 0-9 specifying the
18-
nth color in the currently active color cycle.
19-
20-
See help(colors) for more info.
29+
* the :ref:`sphx_glr_tutorials_colors_colors.py` tutorial;
30+
* the `matplotlib.colors` API;
31+
* the :ref:`sphx_glr_gallery_color_named_colors.py` example.
2132
"""
33+
2234
import matplotlib.pyplot as plt
2335
import numpy as np
2436

25-
t = np.arange(0.0, 2.0, 0.01)
37+
t = np.linspace(0.0, 2.0, 201)
2638
s = np.sin(2 * np.pi * t)
2739

28-
fig, ax = plt.subplots(facecolor='darkslategray')
29-
ax.plot(t, s, 'C1')
30-
ax.set_xlabel('time (s)', color='C1')
31-
ax.set_ylabel('voltage (mV)', color='0.5') # grayscale color
32-
ax.set_title('About as silly as it gets, folks', color='#afeeee')
40+
# 1) RGB tuple:
41+
fig, ax = plt.subplots(facecolor=(.18, .31, .31))
42+
# 2) hex string:
43+
ax.set_facecolor('#eafff5')
44+
# 3) gray level string:
45+
ax.set_title('Voltage vs. time chart', color='0.7')
46+
# 4) single letter color string
47+
ax.set_xlabel('time (s)', color='c')
48+
# 5) a named color:
49+
ax.set_ylabel('voltage (mV)', color='peachpuff')
50+
# 6) a named xkcd color:
51+
ax.plot(t, s, 'xkcd:crimson')
52+
# 7) Cn notation:
53+
ax.plot(t, .7*s, color='C4', linestyle='--')
54+
# 8) tab notation:
55+
ax.tick_params(labelcolor='tab:orange')
56+
3357

3458
plt.show()
59+
60+
#############################################################################
61+
#
62+
# ------------
63+
#
64+
# References
65+
# """"""""""
66+
#
67+
# The use of the following functions, methods, classes and modules is shown
68+
# in this example:
69+
70+
import matplotlib
71+
matplotlib.colors
72+
matplotlib.axes.Axes.plot
73+
matplotlib.axes.Axes.set_facecolor
74+
matplotlib.axes.Axes.set_title
75+
matplotlib.axes.Axes.set_xlabel
76+
matplotlib.axes.Axes.set_ylabel
77+
matplotlib.axes.Axes.tick_params

0 commit comments

Comments
 (0)