Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 56666b8

Browse filesBrowse files
committed
Merge branch 'v3.2.0-doc' into v3.2.x
2 parents 4897c4d + a40622f commit 56666b8
Copy full SHA for 56666b8

File tree

Expand file treeCollapse file tree

9 files changed

+86
-47
lines changed
Filter options
Expand file treeCollapse file tree

9 files changed

+86
-47
lines changed

‎.circleci/config.yml

Copy file name to clipboardExpand all lines: .circleci/config.yml
+1-8Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Circle CI configuration file
22
# https://circleci.com/docs/
33

4-
version: 2
4+
version: 2.1
55

66

77
###########################################
@@ -115,10 +115,6 @@ jobs:
115115
- store_artifacts:
116116
path: doc/build/html
117117

118-
- run:
119-
name: "Built documentation is available at:"
120-
command: echo "${CIRCLE_BUILD_URL}/artifacts/${CIRCLE_NODE_INDEX}/${CIRCLE_WORKING_DIRECTORY/#\~/$HOME}/doc/build/html/index.html"
121-
122118
docs-python37:
123119
docker:
124120
- image: circleci/python:3.7
@@ -141,9 +137,6 @@ jobs:
141137
- store_artifacts:
142138
path: doc/build/html
143139

144-
- run:
145-
name: "Built documentation is available at:"
146-
command: echo "${CIRCLE_BUILD_URL}/artifacts/${CIRCLE_NODE_INDEX}/${CIRCLE_WORKING_DIRECTORY/#\~/$HOME}/doc/build/html/index.html"
147140

148141
- add_ssh_keys:
149142
fingerprints:

‎.github/workflows/circleci.yml

Copy file name to clipboard
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
on: [status]
2+
jobs:
3+
circleci_artifacts_redirector_job:
4+
runs-on: ubuntu-latest
5+
name: Run CircleCI artifacts redirector
6+
steps:
7+
- name: GitHub Action step
8+
uses: larsoner/circleci-artifacts-redirector-action@master
9+
with:
10+
repo-token: ${{ secrets.GITHUB_TOKEN }}
11+
artifact-path: 0/doc/build/html/index.html
12+
circleci-jobs: docs-python36,docs-python37
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="sidebar-announcement">
22
<p>Matplotlib 3.0 is Python 3 only.</p>
3-
<p>For Python 2 support, Matplotlib 2.2.x will be continued as a LTS release
4-
and updated with bugfixes until January 1, 2020.</p>
3+
<p>Python 2 support has been dropped on January 1, 2020.</p>
4+
<p>The last Python 2 compatible release is 2.2.5.</p>
55
</div>

‎doc/devel/contributing.rst

Copy file name to clipboardExpand all lines: doc/devel/contributing.rst
+23-7Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ environment is set up properly::
174174
Contributing code
175175
=================
176176

177+
.. _how-to-contribute:
178+
177179
How to contribute
178180
-----------------
179181

@@ -222,7 +224,7 @@ want to consider sending an email to the mailing list for more visibility.
222224
* `Git documentation <https://git-scm.com/documentation>`_
223225
* `Git-Contributing to a Project <https://git-scm.com/book/en/v2/GitHub-Contributing-to-a-Project>`_
224226
* `Introduction to GitHub <https://lab.github.com/githubtraining/introduction-to-github>`_
225-
* :ref:`development-workflow`.
227+
* :ref:`development-workflow`
226228
* :ref:`using-git`
227229

228230
Contributing pull requests
@@ -316,21 +318,35 @@ This helps the contributor become familiar with the contribution
316318
workflow, and for the core devs to become acquainted with the contributor;
317319
besides which, we frequently underestimate how easy an issue is to solve!
318320

319-
.. _other_ways_to_contribute:
320321

321-
Other ways to contribute
322-
=========================
322+
.. _contributing_documentation:
323323

324+
Contributing documentation
325+
==========================
324326

325327
Code is not the only way to contribute to Matplotlib. For instance,
326328
documentation is also a very important part of the project and often doesn't
327329
get as much attention as it deserves. If you find a typo in the documentation,
328330
or have made improvements, do not hesitate to send an email to the mailing
329-
list or submit a GitHub pull request. Full documentation can be found under
330-
the doc/ directory.
331+
list or submit a GitHub pull request. To make a pull request, refer to the
332+
guidelines outlined in :ref:`how-to-contribute`.
333+
334+
Full documentation can be found under the :file:`doc/`, :file:`tutorials/`,
335+
and :file:`examples/` directories.
336+
337+
.. seealso::
338+
* :ref:`documenting-matplotlib`
339+
340+
341+
.. _other_ways_to_contribute:
342+
343+
Other ways to contribute
344+
=========================
331345

332346
It also helps us if you spread the word: reference the project from your blog
333-
and articles or link to it from your website!
347+
and articles or link to it from your website! If Matplotlib contributes to a
348+
project that leads to a scientific publication, please follow the
349+
:doc:`/citing` guidelines.
334350

335351
.. _coding_guidelines:
336352

‎doc/devel/documenting_mpl.rst

Copy file name to clipboardExpand all lines: doc/devel/documenting_mpl.rst
+42-20Lines changed: 42 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,45 +18,67 @@ Getting started
1818
General file structure
1919
----------------------
2020

21-
All documentation is built from the :file:`doc/` directory. This directory
22-
contains both reStructuredText (ReST_; ``.rst``) files that contain pages in
23-
the documentation and configuration files for Sphinx_.
21+
All documentation is built from the :file:`doc/`, :file:`tutorials/`, and
22+
:file:`examples/` directories. The :file:`doc/` directory contains configuration files for Sphinx
23+
and reStructuredText (ReST_; ``.rst``) files that are rendered to documentation pages.
2424

25-
The ``.rst`` files are kept in :file:`doc/users`,
26-
:file:`doc/devel`, :file:`doc/api` and :file:`doc/faq`. The main entry point is
27-
:file:`doc/index.rst`, which pulls in the :file:`index.rst` file for the users
28-
guide, developers guide, api reference, and FAQs. The documentation suite is
29-
built as a single document in order to make the most effective use of cross
30-
referencing.
25+
26+
The main entry point is :file:`doc/index.rst`, which pulls in the
27+
:file:`index.rst` file for the users guide (:file:`doc/users`), developers
28+
guide (:file:`doc/devel`), api reference (:file:`doc/api`), and FAQs
29+
(:file:`doc/faq`). The documentation suite is built as a single document in
30+
order to make the most effective use of cross referencing.
3131

3232
Sphinx_ also creates ``.rst`` files that are staged in :file:`doc/api` from
3333
the docstrings of the classes in the Matplotlib library. Except for
3434
:file:`doc/api/api_changes/`, these ``.rst`` files are created when the
3535
documentation is built.
3636

3737
Similarly, the contents of :file:`doc/gallery` and :file:`doc/tutorials` are
38-
generated by the `Sphinx Gallery`_ from the sources in :file:`examples` and
39-
:file:`tutorials`. These sources consist of python scripts that have ReST_
40-
documentation built into their comments. Don't directly edit the
41-
``.rst`` files in :file:`doc/gallery` and :file:`doc/tutorials` as they are
42-
regenerated when the documentation are built.
38+
generated by the `Sphinx Gallery`_ from the sources in :file:`examples/` and
39+
:file:`tutorials/`. These sources consist of python scripts that have ReST_
40+
documentation built into their comments.
41+
42+
.. note::
43+
44+
Don't directly edit the ``.rst`` files in :file:`doc/gallery`,
45+
:file:`doc/tutorials`, and :file:`doc/api` (excepting
46+
:file:`doc/api/api_changes/`). Sphinx_ regenerates files in these
47+
directories when building documentation.
4348

4449
Installing dependencies
4550
-----------------------
4651

4752
The documentation for Matplotlib is generated from reStructuredText (ReST_)
48-
using the Sphinx_ documentation generation tool. There are several extra
49-
requirements that are needed to build the documentation. They are listed in
50-
:file:`doc-requirements.txt`, which is shown below:
53+
using the Sphinx_ documentation generation tool. To build the documentation
54+
you will need to (1) set up an appropriate Python environment and (2)
55+
separately install LaTeX and Graphviz.
56+
57+
To (1) set up an appropriate Python environment for building the
58+
documentation, you should:
59+
60+
* create a clean virtual environment with no existing Matplotlib
61+
installation
62+
* install the Python packages required for Matplotlib
63+
* install the additional Python packages required to build the documentation
64+
65+
There are several extra python packages that are needed to build the
66+
documentation. They are listed in :file:`doc-requirements.txt`, which is
67+
shown below:
5168

5269
.. include:: ../../requirements/doc/doc-requirements.txt
5370
:literal:
5471

72+
To (2) set up LaTeX and Graphviz dependencies you should:
73+
74+
* install a minimal working LaTeX distribution
75+
* install the LaTeX packages cm-super and dvipng
76+
* install `Graphviz <http://www.graphviz.org/download>`_
77+
5578
.. note::
5679

57-
* You'll need a minimal working LaTeX distribution for many examples to run.
58-
* `Graphviz <http://www.graphviz.org/Download.php>`_ is not a Python package,
59-
and needs to be installed separately.
80+
The documentation will not build without LaTeX and Graphviz. These are not
81+
Python packages and must be installed separately.
6082

6183
Building the docs
6284
-----------------

‎examples/scales/log_bar.py

Copy file name to clipboardExpand all lines: examples/scales/log_bar.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
y = [d[i] for d in data]
2121
b = ax.bar(x + i * dimw, y, dimw, bottom=0.001)
2222

23-
ax.set_xticks(x + dimw / 2, map(str, x))
23+
ax.set_xticks(x + dimw / 2)
24+
ax.set_xticklabels(map(str, x))
2425
ax.set_yscale('log')
2526

2627
ax.set_xlabel('x')

‎examples/text_labels_and_annotations/text_rotation.py

Copy file name to clipboardExpand all lines: examples/text_labels_and_annotations/text_rotation.py
+2-3Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,20 @@ def addtext(ax, props):
3030
for x in range(0, 5):
3131
ax.scatter(x + 0.5, 0.5, color='r', alpha=0.5)
3232
ax.set_yticks([0, .5, 1])
33+
ax.set_xticks(np.arange(0, 5.1, 0.5))
3334
ax.set_xlim(0, 5)
3435
ax.grid(True)
3536

3637

3738
# the text bounding box
3839
bbox = {'fc': '0.8', 'pad': 0}
3940

40-
fig, axs = plt.subplots(2, 1)
41+
fig, axs = plt.subplots(2, 1, sharex=True)
4142

4243
addtext(axs[0], {'ha': 'center', 'va': 'center', 'bbox': bbox})
43-
axs[0].set_xticks(np.arange(0, 5.1, 0.5), [])
4444
axs[0].set_ylabel('center / center')
4545

4646
addtext(axs[1], {'ha': 'left', 'va': 'bottom', 'bbox': bbox})
47-
axs[1].set_xticks(np.arange(0, 5.1, 0.5))
4847
axs[1].set_ylabel('left / bottom')
4948

5049
plt.show()

‎lib/matplotlib/lines.py

Copy file name to clipboardExpand all lines: lib/matplotlib/lines.py
-3Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,9 +1165,6 @@ def set_linestyle(self, ls):
11651165
``'None'`` or ``' '`` or ``''`` draw nothing
11661166
=============================== =================
11671167
1168-
Optionally, the string may be preceded by a drawstyle, e.g.
1169-
``'steps--'``. See :meth:`set_drawstyle` for details.
1170-
11711168
- Alternatively a dash tuple of the following form can be
11721169
provided::
11731170

‎tutorials/colors/colormaps.py

Copy file name to clipboardExpand all lines: tutorials/colors/colormaps.py
+2-3Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def plot_color_gradients(cmap_category, cmap_list, nrows):
225225
plt.show()
226226

227227
###############################################################################
228-
# Lightness of matplotlib colormaps
228+
# Lightness of Matplotlib colormaps
229229
# =================================
230230
#
231231
# Here we examine the lightness values of the matplotlib colormaps.
@@ -308,10 +308,9 @@ def plot_color_gradients(cmap_category, cmap_list, nrows):
308308
formatter = mpl.ticker.FixedFormatter(cmap_list[i*dsub:(i+1)*dsub])
309309
ax.xaxis.set_major_formatter(formatter)
310310
ax.xaxis.set_tick_params(rotation=50)
311+
ax.set_ylabel('Lightness $L^*$', fontsize=12)
311312

312313
ax.set_xlabel(cmap_category + ' colormaps', fontsize=14)
313-
fig.text(0.0, 0.55, 'Lightness $L^*$', fontsize=12,
314-
transform=fig.transFigure, rotation=90)
315314

316315
fig.tight_layout(h_pad=0.0, pad=1.5)
317316
plt.show()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.