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

Skip to content

Commit c9b2ad9

Browse files
committed
Merge branch 'sphinx_gallery' of https://github.com/NelleV/matplotlib into sphinx_gallery
2 parents 102b4a5 + 8b764e7 commit c9b2ad9

File tree

139 files changed

+225
-305
lines changed

Some content is hidden

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

139 files changed

+225
-305
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
build
3333
# sphinx build directory
3434
doc/_build
35+
doc/auto_examples
3536
# setup.py dist directory
3637
dist
3738
# Egg metadata
@@ -58,7 +59,6 @@ lib/matplotlib/mpl-data/matplotlibrc
5859
# Documentation generated files #
5960
#################################
6061
doc/examples
61-
doc/_templates/gallery.html
6262
doc/users/installing.rst
6363
doc/_static/matplotlibrc
6464
doc/pyplots/tex_demo.png

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ install:
142142
pip install -ve .
143143
144144
script: source ci/travis/test_script.sh
145+
145146
before_cache:
146147
- rm -rf $HOME/.cache/matplotlib/tex.cache
147148
- rm -rf $HOME/.cache/matplotlib/test_cache

ci/travis/test_script.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ if [[ $BUILD_DOCS == false ]]; then
3030
fi
3131
else
3232
cd doc
33-
python make.py html -n 2
33+
python make.py html
3434
# We don't build the LaTeX docs here, so linkchecker will complain
3535
touch build/html/Matplotlib.pdf
3636
# Linkchecker only works with python 2.7 for the time being

doc-requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ ipython
1212
mock
1313
colorspacious
1414
pillow
15+
sphinx-gallery

doc/README.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ All of these dependencies *except graphviz* can be installed through pip::
2121

2222
or all of them via conda and pip::
2323

24-
conda install sphinx numpydoc ipython mock graphviz pillow
24+
conda install sphinx numpydoc ipython mock graphviz pillow \
25+
sphinx-gallery
2526
pip install colorspacious
2627

2728
To build the HTML documentation, type ``python make.py html`` in this

doc/_templates/index.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ <h1>Introduction</h1>
7575
<p>Matplotlib tries to make easy things easy and hard things possible.
7676
You can generate plots, histograms, power spectra, bar charts,
7777
errorcharts, scatterplots, etc., with just a few lines of code.
78-
For a sampling, see the <a href="{{ pathto('users/screenshots') }}">screenshots</a>, <a href="{{ pathto('gallery') }}">thumbnail</a> gallery, and
78+
For a sampling, see the <a href="{{ pathto('users/screenshots')
79+
}}">screenshots</a>, <a href="{{ pathto('auto_examples/index') }}">thumbnail</a> gallery, and
7980
<a href="{{ pathto('examples/index') }}">examples</a> directory</p>
8081

8182
<p>For simple plotting the <tt>pyplot</tt> module provides a
@@ -99,7 +100,7 @@ <h1>Documentation</h1>
99100
</script>
100101

101102
<p>Trying to learn how to do a particular kind of plot? Check out
102-
the <a href="{{ pathto('gallery') }}">gallery</a>, <a href="{{ pathto('examples/index') }}">examples</a>,
103+
the <a href="{{ pathto('auto_examples/index') }}">gallery</a>, <a href="{{ pathto('examples/index') }}">examples</a>,
103104
or the <a href="{{ pathto('api/pyplot_summary') }}">list of plotting
104105
commands</a>.</p>
105106

doc/_templates/layout.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ <h3>{{ _('Navigation') }}</h3>
3939

4040
<li><a href="{{ pathto('index') }}">home</a>|&nbsp;</li>
4141
<li><a href="{{ pathto('examples/index') }}">examples</a>|&nbsp;</li>
42-
<li><a href="{{ pathto('gallery') }}">gallery</a>|&nbsp;</li>
42+
<li><a href="{{ pathto('auto_examples/index') }}">gallery</a>|&nbsp;</li>
4343
<li><a href="{{ pathto('api/pyplot_summary') }}">pyplot</a>|&nbsp;</li>
4444
<li><a href="{{ pathto('contents') }}">docs</a> &raquo;</li>
4545

doc/conf.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@
2929
extensions = ['matplotlib.sphinxext.mathmpl', 'sphinxext.math_symbol_table',
3030
'sphinx.ext.autodoc', 'matplotlib.sphinxext.only_directives',
3131
'sphinx.ext.doctest', 'sphinx.ext.autosummary',
32-
'matplotlib.sphinxext.plot_directive',
3332
'sphinx.ext.inheritance_diagram',
34-
'sphinxext.gen_gallery', 'sphinxext.gen_rst',
33+
'sphinx_gallery.gen_gallery',
34+
'sphinxext.gen_rst',
35+
'matplotlib.sphinxext.plot_directive',
3536
'sphinxext.github',
3637
'numpydoc']
3738

@@ -53,6 +54,12 @@
5354
raise ImportError("No module named numpydoc - you need to install "
5455
"numpydoc to build the documentation.")
5556

57+
try:
58+
import sphinx_gallery
59+
except ImportError:
60+
raise ImportError("No module named sphinx_gallery - you need to install "
61+
"sphinx_gallery to build the documentation.")
62+
5663
try:
5764
import colorspacious
5865
except ImportError:
@@ -96,6 +103,16 @@
96103

97104
autodoc_docstring_signature = True
98105

106+
107+
# Sphinx gallery configuration
108+
sphinx_gallery_conf = {
109+
# path to your examples scripts
110+
'examples_dirs' : '../examples',
111+
# path where to save gallery generated examples
112+
'gallery_dirs' : 'auto_examples'}
113+
114+
plot_gallery = True
115+
99116
# Add any paths that contain templates here, relative to this directory.
100117
templates_path = ['_templates']
101118

@@ -234,7 +251,6 @@
234251
# Additional templates that should be rendered to pages, maps page names to
235252
# template names.
236253
html_additional_pages = {'index': 'index.html',
237-
'gallery':'gallery.html',
238254
'citing': 'citing.html'}
239255

240256
# If false, no module index is generated.

doc/devel/contributing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ We have hundreds of examples in subdirectories of
442442
:file:`matplotlib/examples`, and these are automatically generated
443443
when the website is built to show up both in the `examples
444444
<../examples/index.html>`_ and `gallery
445-
<../gallery.html>`_ sections of the website.
445+
<../auto_examples/index.html>`_ sections of the website.
446446

447447
Any sample data that the example uses should be kept small and
448448
distributed with Matplotlib in the

doc/mpl_toolkits/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ plotting (scatter, surf, line, mesh) tools. Not the fastest or feature
3030
complete 3D library out there, but ships with Matplotlib and thus may be a
3131
lighter weight solution for some use cases.
3232

33-
.. plot:: mpl_examples/mplot3d/contourf3d_demo2.py
33+
.. plot:: auto_examples/mplot3d/plot_contourf3d_2.py
3434

3535
.. _toolkit_axes_grid1:
3636

doc/mpl_toolkits/mplot3d/tutorial.rst

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -36,41 +36,41 @@ Line plots
3636
====================
3737
.. automethod:: Axes3D.plot
3838

39-
.. plot:: mpl_examples/mplot3d/lines3d_demo.py
39+
.. plot:: auto_examples/mplot3d/plot_lines3d.py
4040

4141
.. _scatter3d:
4242

4343
Scatter plots
4444
=============
4545
.. automethod:: Axes3D.scatter
4646

47-
.. plot:: mpl_examples/mplot3d/scatter3d_demo.py
47+
.. plot:: auto_examples/mplot3d/plot_scatter3d.py
4848

4949
.. _wireframe:
5050

5151
Wireframe plots
5252
===============
5353
.. automethod:: Axes3D.plot_wireframe
5454

55-
.. plot:: mpl_examples/mplot3d/wire3d_demo.py
55+
.. plot:: auto_examples/mplot3d/plot_wire3d.py
5656

5757
.. _surface:
5858

5959
Surface plots
6060
=============
6161
.. automethod:: Axes3D.plot_surface
6262

63-
.. plot:: mpl_examples/mplot3d/surface3d_demo.py
64-
.. plot:: mpl_examples/mplot3d/surface3d_demo2.py
65-
.. plot:: mpl_examples/mplot3d/surface3d_demo3.py
63+
.. plot:: auto_examples/mplot3d/plot_surface3d.py
64+
.. plot:: auto_examples/mplot3d/plot_surface3d_2.py
65+
.. plot:: auto_examples/mplot3d/plot_surface3d_3.py
6666

6767
.. _trisurface:
6868

6969
Tri-Surface plots
7070
=================
7171
.. automethod:: Axes3D.plot_trisurf
7272

73-
.. plot:: mpl_examples/mplot3d/trisurf3d_demo.py
73+
.. plot:: auto_examples/mplot3d/plot_trisurf3d.py
7474

7575

7676
.. _contour3d:
@@ -79,18 +79,18 @@ Contour plots
7979
=============
8080
.. automethod:: Axes3D.contour
8181

82-
.. plot:: mpl_examples/mplot3d/contour3d_demo.py
83-
.. plot:: mpl_examples/mplot3d/contour3d_demo2.py
84-
.. plot:: mpl_examples/mplot3d/contour3d_demo3.py
82+
.. plot:: auto_examples/mplot3d/plot_contour3d.py
83+
.. plot:: auto_examples/mplot3d/plot_contour3d_2.py
84+
.. plot:: auto_examples/mplot3d/plot_contour3d_3.py
8585

8686
.. _contourf3d:
8787

8888
Filled contour plots
8989
====================
9090
.. automethod:: Axes3D.contourf
9191

92-
.. plot:: mpl_examples/mplot3d/contourf3d_demo.py
93-
.. plot:: mpl_examples/mplot3d/contourf3d_demo2.py
92+
.. plot:: auto_examples/mplot3d/plot_contourf3d.py
93+
.. plot:: auto_examples/mplot3d/plot_contourf3d_2.py
9494

9595
.. versionadded:: 1.1.0
9696
The feature demoed in the second contourf3d example was enabled as a
@@ -102,37 +102,37 @@ Polygon plots
102102
====================
103103
.. automethod:: Axes3D.add_collection3d
104104

105-
.. plot:: mpl_examples/mplot3d/polys3d_demo.py
105+
.. plot:: auto_examples/mplot3d/plot_polys3d.py
106106

107107
.. _bar3d:
108108

109109
Bar plots
110110
====================
111111
.. automethod:: Axes3D.bar
112112

113-
.. plot:: mpl_examples/mplot3d/bars3d_demo.py
113+
.. plot:: auto_examples/mplot3d/plot_bars3d.py
114114

115115
.. _quiver3d:
116116

117117
Quiver
118118
====================
119119
.. automethod:: Axes3D.quiver
120120

121-
.. plot:: mpl_examples/mplot3d/quiver3d_demo.py
121+
.. plot:: auto_examples/mplot3d/plot_quiver3d.py
122122

123123
.. _2dcollections3d:
124124

125125
2D plots in 3D
126126
====================
127-
.. plot:: mpl_examples/mplot3d/2dcollections3d_demo.py
127+
.. plot:: auto_examples/mplot3d/plot_2dcollections3d.py
128128

129129
.. _text3d:
130130

131131
Text
132132
====================
133133
.. automethod:: Axes3D.text
134134

135-
.. plot:: mpl_examples/mplot3d/text3d_demo.py
135+
.. plot:: auto_examples/mplot3d/plot_text3d.py
136136

137137
.. _3dsubplots:
138138

@@ -146,5 +146,5 @@ in the same figure.
146146
Subplotting 3D plots was added in v1.0.0. Earlier version can not
147147
do this.
148148

149-
.. plot:: mpl_examples/mplot3d/subplot3d_demo.py
150-
.. plot:: mpl_examples/mplot3d/mixed_subplots_demo.py
149+
.. plot:: auto_examples/mplot3d/plot_subplot3d.py
150+
.. plot:: auto_examples/mplot3d/plot_mixed_subplots.py

0 commit comments

Comments
 (0)