Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d5db532

Browse files
committed
DOC: move tutorials [ci doc]
1 parent 4da460e commit d5db532

File tree

19 files changed

+196
-74
lines changed

19 files changed

+196
-74
lines changed

.flake8

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@ per-file-ignores =
6060
galleries/users_explain/artists/transforms_tutorial.py: E402, E501
6161
galleries/users_explain/colors/colormaps.py: E501
6262
galleries/users_explain/colors/colors.py: E402
63-
galleries/tutorials/intermediate/artists.py: E402
63+
galleries/tutorials/artists.py: E402
6464
galleries/users_explain/axes/constrainedlayout_guide.py: E402
6565
galleries/users_explain/axes/legend_guide.py: E402
6666
galleries/users_explain/axes/tight_layout_guide.py: E402
6767
galleries/users_explain/animations/animations.py: E501
68-
galleries/tutorials/introductory/images.py: E501
69-
galleries/tutorials/introductory/pyplot.py: E402, E501
68+
galleries/tutorials/images.py: E501
69+
galleries/tutorials/pyplot.py: E402, E501
7070
galleries/users_explain/text/annotations.py: E402, E501
7171
galleries/users_explain/text/mathtext.py: E501
7272
galleries/users_explain/text/text_intro.py: E402

doc/api/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ programmatic plot generation.
7575
Further reading:
7676

7777
- The `matplotlib.pyplot` function reference
78-
- :doc:`/tutorials/introductory/pyplot`
78+
- :ref:`pyplot_tutorial`
7979
- :ref:`Pyplot examples <pyplots_examples>`
8080

8181
.. _api-index:

doc/index.rst

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Learning resources
5151

5252
- :ref:`Quick-start guide <quick_start>`
5353
- :doc:`Plot types <plot_types/index>`
54-
- :ref:`Introductory tutorials <tutorials-introductory>`
54+
- :ref:`users-guide-using`
5555
- :doc:`External learning resources <users/resources/index>`
5656

5757
.. grid-item-card::
@@ -69,11 +69,8 @@ Learning resources
6969
Understand how Matplotlib works
7070
^^^
7171

72-
- The :ref:`users-guide-explain` in the :doc:`Users guide
73-
<users/index>`
74-
- Many of the :ref:`Intermediate <tutorials-intermediate>` and
75-
:ref:`Advanced <tutorials-advanced>` tutorials have explanatory
76-
material
72+
- :ref:`users-guide-explain` in the :doc:`Users guide
73+
<users/index>` has a number of advanced topics.
7774

7875
.. grid-item-card::
7976
:padding: 2

doc/users/faq/howto_faq.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ actually perform such a rendering and inspect the result.
9797
Find all objects in a figure of a certain type
9898
----------------------------------------------
9999

100-
Every Matplotlib artist (see :doc:`/tutorials/intermediate/artists`) has a method
100+
Every Matplotlib artist (see :ref:`artists_tutorial`) has a method
101101
called :meth:`~matplotlib.artist.Artist.findobj` that can be used to
102102
recursively search the artist for any artists it may contain that meet
103103
some criteria (e.g., match all :class:`~matplotlib.lines.Line2D`

doc/users/prev_whats_new/whats_new_0.99.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ New documentation
1313

1414
Jae-Joon Lee has written two new guides :ref:`legend_guide`
1515
and :ref:`plotting-guide-annotation`. Michael Sarahan has written
16-
:doc:`/tutorials/introductory/images`. John Hunter has written two new tutorials on
16+
:ref:`image_tutorial`. John Hunter has written two new tutorials on
1717
working with paths and transformations: :ref:`paths` and
1818
:ref:`transforms_tutorial`.
1919

doc/users/project/history.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ The Matplotlib code is conceptually divided into three parts: the
6868
*pylab interface* is the set of functions provided by
6969
:mod:`pylab` which allow the user to create plots with code
7070
quite similar to MATLAB figure generating code
71-
(:doc:`/tutorials/introductory/pyplot`). The *Matplotlib frontend* or *Matplotlib
71+
(:ref:`pyplot_tutorial`). The *Matplotlib frontend* or *Matplotlib
7272
API* is the set of classes that do the heavy lifting, creating and
7373
managing figures, text, lines, plots and so on
74-
(:doc:`/tutorials/intermediate/artists`). This is an abstract interface that knows
74+
(:ref:`artists_tutorial`). This is an abstract interface that knows
7575
nothing about output. The *backends* are device-dependent drawing
7676
devices, aka renderers, that transform the frontend representation to
7777
hardcopy or a display device (:ref:`what-is-a-backend`). Example

galleries/tutorials/README.txt

Lines changed: 0 additions & 12 deletions
This file was deleted.

galleries/tutorials/advanced/README.txt

Lines changed: 0 additions & 7 deletions
This file was deleted.

galleries/tutorials/intermediate/artists.py renamed to galleries/tutorials/artists.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
"""
2+
.. redirect-from:: /tutorials/intermediate/artists
3+
4+
.. _artists_tutorial:
5+
26
===============
37
Artist tutorial
48
===============
@@ -716,6 +720,6 @@ class in the Matplotlib API, and the one you will be working with most
716720
# dollar signs and colors them green on the right side of the yaxis.
717721
#
718722
#
719-
# .. include:: ../../gallery/ticks/dollar_ticks.rst
723+
# .. include:: ../gallery/ticks/dollar_ticks.rst
720724
# :start-after: .. redirect-from:: /gallery/pyplots/dollar_ticks
721725
# :end-before: .. admonition:: References

galleries/tutorials/introductory/images.py renamed to galleries/tutorials/images.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
"""
2+
.. redirect-from:: /tutorials/introductory/images
3+
4+
.. _image_tutorial:
5+
26
==============
37
Image tutorial
48
==============
@@ -65,7 +69,7 @@
6569
#
6670
# Here's the image we're going to play with:
6771
#
68-
# .. image:: ../../_static/stinkbug.png
72+
# .. image:: ../_static/stinkbug.png
6973
#
7074
# It's a 24-bit RGB PNG image (8 bits for each of R, G, B). Depending
7175
# on where you get your data, the other kinds of image that you'll most
@@ -78,7 +82,7 @@
7882
# convert the `PIL.Image.Image` object into an 8-bit (``dtype=uint8``) numpy
7983
# array.
8084

81-
img = np.asarray(Image.open('../../../doc/_static/stinkbug.png'))
85+
img = np.asarray(Image.open('../../doc/_static/stinkbug.png'))
8286
print(repr(img))
8387

8488
# %%
@@ -227,7 +231,7 @@
227231
# We'll use the Pillow library that we used to load the image also to resize
228232
# the image.
229233

230-
img = Image.open('../../../doc/_static/stinkbug.png')
234+
img = Image.open('../../doc/_static/stinkbug.png')
231235
img.thumbnail((64, 64)) # resizes image in-place
232236
imgplot = plt.imshow(img)
233237

galleries/tutorials/index.rst

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
.. _tutorials:
2+
3+
Tutorials
4+
=========
5+
6+
This page contains a few tutorials for using Matplotlib. For the old tutorials, see :ref:`below <user_guide_tutorials>`.
7+
8+
For shorter examples, see our :ref:`examples page <examples-index>`.
9+
You can also find :ref:`external resources <resources-index>` and
10+
a :ref:`FAQ <faq-index>` in our :ref:`user guide <users-guide-index>`.
11+
12+
13+
.. raw:: html
14+
15+
<div class="sphx-glr-thumbnails">
16+
17+
18+
.. raw:: html
19+
20+
<div class="sphx-glr-thumbcontainer" tooltip="An introduction to the pyplot interface. Please also see quick_start for an overview of how Ma...">
21+
22+
.. only:: html
23+
24+
.. image:: /tutorials/images/thumb/sphx_glr_pyplot_thumb.png
25+
:alt: Pyplot tutorial
26+
27+
:ref:`sphx_glr_tutorials_pyplot.py`
28+
29+
.. raw:: html
30+
31+
<div class="sphx-glr-thumbnail-title">Pyplot tutorial</div>
32+
</div>
33+
34+
35+
.. raw:: html
36+
37+
<div class="sphx-glr-thumbcontainer" tooltip="A short tutorial on plotting images with Matplotlib.">
38+
39+
.. only:: html
40+
41+
.. image:: /tutorials/images/thumb/sphx_glr_images_thumb.png
42+
:alt: Image tutorial
43+
44+
:ref:`sphx_glr_tutorials_images.py`
45+
46+
.. raw:: html
47+
48+
<div class="sphx-glr-thumbnail-title">Image tutorial</div>
49+
</div>
50+
51+
52+
.. raw:: html
53+
54+
<div class="sphx-glr-thumbcontainer" tooltip="This tutorial aims to show the beginning, middle, and end of a single visualization using Matpl...">
55+
56+
.. only:: html
57+
58+
.. image:: /tutorials/images/thumb/sphx_glr_lifecycle_thumb.png
59+
:alt: The Lifecycle of a Plot
60+
61+
:ref:`sphx_glr_tutorials_lifecycle.py`
62+
63+
.. raw:: html
64+
65+
<div class="sphx-glr-thumbnail-title">The Lifecycle of a Plot</div>
66+
</div>
67+
68+
69+
.. raw:: html
70+
71+
<div class="sphx-glr-thumbcontainer" tooltip="Using Artist objects to render on the canvas.">
72+
73+
.. only:: html
74+
75+
.. image:: /tutorials/images/thumb/sphx_glr_artists_thumb.png
76+
:alt: Artist tutorial
77+
78+
:ref:`sphx_glr_tutorials_artists.py`
79+
80+
.. raw:: html
81+
82+
<div class="sphx-glr-thumbnail-title">Artist tutorial</div>
83+
</div>
84+
85+
86+
.. raw:: html
87+
88+
</div>
89+
90+
91+
.. toctree::
92+
:hidden:
93+
94+
/tutorials/pyplot
95+
/tutorials/images
96+
/tutorials/lifecycle
97+
/tutorials/artists
98+
99+
.. only:: html
100+
101+
.. container:: sphx-glr-footer sphx-glr-footer-gallery
102+
103+
.. container:: sphx-glr-download sphx-glr-download-python
104+
105+
:download:`Download all examples in Python source code: tutorials_python.zip </tutorials/tutorials_python.zip>`
106+
107+
.. container:: sphx-glr-download sphx-glr-download-jupyter
108+
109+
:download:`Download all examples in Jupyter notebooks: tutorials_jupyter.zip </tutorials/tutorials_jupyter.zip>`
110+
111+
112+
113+
.. _user_guide_tutorials:
114+
115+
User guide tutorials
116+
--------------------
117+
118+
Many of our tutorials were moved from this section to :ref:`users-guide-explain`:
119+
120+
Introductory
121+
~~~~~~~~~~~~
122+
123+
- :ref:`quick_start`
124+
- :ref:`customizing`
125+
- :ref:`animations`
126+
127+
Intermediate
128+
~~~~~~~~~~~~
129+
130+
- :ref:`legend_guide`
131+
- :ref:`color_cycle`
132+
- :ref:`constrainedlayout_guide`
133+
- :ref:`tight_layout_guide`
134+
- :ref:`arranging_axes`
135+
- :ref:`autoscale`
136+
- :ref:`imshow_extent`
137+
138+
Advanced
139+
~~~~~~~~
140+
141+
- :ref:`blitting`
142+
- :ref:`paths`
143+
- :ref:`patheffects_guide`
144+
- :ref:`transforms_tutorial`
145+
146+
Colors
147+
~~~~~~
148+
149+
See :ref:`tutorials-colors`.
150+
151+
Text
152+
~~~~
153+
154+
See :ref:`tutorials-text`.
155+
156+
Toolkits
157+
~~~~~~~~
158+
159+
See :ref:`tutorials-toolkits`.

galleries/tutorials/intermediate/README.txt

Lines changed: 0 additions & 8 deletions
This file was deleted.

galleries/tutorials/introductory/README.txt

Lines changed: 0 additions & 8 deletions
This file was deleted.

galleries/tutorials/introductory/lifecycle.py renamed to galleries/tutorials/lifecycle.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
"""
2+
.. redirect-from:: /tutorials/introductory/lifecycle
3+
24
=======================
35
The Lifecycle of a Plot
46
=======================
@@ -27,8 +29,8 @@
2729
:class:`axes.Axes` to build up the visualization in an instance of
2830
:class:`figure.Figure`. In the implicit interface, inspired by and modeled on
2931
MATLAB, we use a global state-based interface which is encapsulated in the
30-
:mod:`.pyplot` module to plot to the "current Axes". See the :doc:`pyplot
31-
tutorials </tutorials/introductory/pyplot>` for a more in-depth look at the
32+
:mod:`.pyplot` module to plot to the "current Axes". See the :ref:`pyplot
33+
tutorials <pyplot_tutorial>` for a more in-depth look at the
3234
pyplot interface.
3335
3436
Most of the terms are straightforward but the main thing to remember

galleries/tutorials/provisional/README.txt

Lines changed: 0 additions & 14 deletions
This file was deleted.

galleries/tutorials/introductory/pyplot.py renamed to galleries/tutorials/pyplot.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
"""
2+
.. redirect-from:: /tutorials/introductory/pyplot
3+
4+
.. _pyplot_tutorial:
5+
26
===============
37
Pyplot tutorial
48
===============
@@ -307,7 +311,7 @@ def f(t):
307311
# it annoying that states (specifically the current image, figure and axes)
308312
# are being maintained for you behind the scenes, don't despair: this is just a thin
309313
# stateful wrapper around an object-oriented API, which you can use
310-
# instead (see :doc:`/tutorials/intermediate/artists`)
314+
# instead (see :ref:`artists_tutorial`)
311315
#
312316
# If you are making lots of figures, you need to be aware of one
313317
# more thing: the memory required for a figure is not completely

galleries/users_explain/figure/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ Creating Figures
111111
================
112112

113113
By far the most common way to create a figure is using the
114-
:doc:`pyplot </tutorials/introductory/pyplot>` interface. As noted in
114+
:ref:`pyplot <pyplot_tutorial>` interface. As noted in
115115
:ref:`api_interfaces`, the pyplot interface serves two purposes. One is to spin
116116
up the Backend and keep track of GUI windows. The other is a global state for
117117
Axes and Artists that allow a short-form API to plotting methods. In the

galleries/users_explain/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.. _users-guide-explain:
2+
.. _users-guide-using:
23

34
.. redirect-from:: /users/explain
45

0 commit comments

Comments
 (0)