From b91801667293ef4a5985711aa3432624c857dd35 Mon Sep 17 00:00:00 2001 From: Nelle Varoquaux Date: Wed, 8 Mar 2017 15:56:12 -0800 Subject: [PATCH 01/21] DOC starting the migration to sphinx - Added sphinx-gallery to doc/conf.y - Renamed all conflicting README.txt to README in our example folders --- doc/conf.py | 13 +++++++++++-- examples/api/{README.txt => README} | 0 examples/event_handling/{README.txt => README} | 0 examples/user_interfaces/{README.txt => README} | 0 examples/widgets/{README.txt => README} | 0 5 files changed, 11 insertions(+), 2 deletions(-) rename examples/api/{README.txt => README} (100%) rename examples/event_handling/{README.txt => README} (100%) rename examples/user_interfaces/{README.txt => README} (100%) rename examples/widgets/{README.txt => README} (100%) diff --git a/doc/conf.py b/doc/conf.py index 989f1f946a5d..c88b053b4e50 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -29,9 +29,10 @@ extensions = ['matplotlib.sphinxext.mathmpl', 'sphinxext.math_symbol_table', 'sphinx.ext.autodoc', 'matplotlib.sphinxext.only_directives', 'sphinx.ext.doctest', 'sphinx.ext.autosummary', - 'matplotlib.sphinxext.plot_directive', 'sphinx.ext.inheritance_diagram', - 'sphinxext.gen_gallery', 'sphinxext.gen_rst', + 'sphinx_gallery.gen_gallery', + 'sphinxext.gen_rst', + 'matplotlib.sphinxext.plot_directive', 'sphinxext.github', 'numpydoc'] @@ -96,6 +97,14 @@ autodoc_docstring_signature = True + +# Sphinx gallery configuration +sphinx_gallery_conf = { + # path to your examples scripts + 'examples_dirs' : '../examples', + # path where to save gallery generated examples + 'gallery_dirs' : 'auto_examples'} + # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] diff --git a/examples/api/README.txt b/examples/api/README similarity index 100% rename from examples/api/README.txt rename to examples/api/README diff --git a/examples/event_handling/README.txt b/examples/event_handling/README similarity index 100% rename from examples/event_handling/README.txt rename to examples/event_handling/README diff --git a/examples/user_interfaces/README.txt b/examples/user_interfaces/README similarity index 100% rename from examples/user_interfaces/README.txt rename to examples/user_interfaces/README diff --git a/examples/widgets/README.txt b/examples/widgets/README similarity index 100% rename from examples/widgets/README.txt rename to examples/widgets/README From b110b1f715e0930e18c1e7d84ff5a03f8f4b97dc Mon Sep 17 00:00:00 2001 From: Nelle Varoquaux Date: Wed, 8 Mar 2017 17:59:45 -0800 Subject: [PATCH 02/21] DOC Set up sphinx-gallery in parallel of our own gallery --- doc/conf.py | 2 ++ doc/users/image_tutorial.rst | 2 +- doc/users/prev_whats_new/whats_new_1.1.rst | 2 +- doc/users/prev_whats_new/whats_new_1.5.rst | 2 +- examples/color/README.txt | 4 ++++ examples/color/{color_cycle_demo.py => plot_color_cycle.py} | 0 .../{color_cycle_default.py => plot_color_cycle_default.py} | 0 .../{colormaps_reference.py => plot_colormaps_reference.py} | 0 examples/lines_bars_and_markers/README.txt | 4 ++++ examples/lines_bars_and_markers/scatter_with_legend.py | 4 +++- examples/pie_and_polar_charts/README.txt | 4 ++++ 11 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 examples/color/README.txt rename examples/color/{color_cycle_demo.py => plot_color_cycle.py} (100%) rename examples/color/{color_cycle_default.py => plot_color_cycle_default.py} (100%) rename examples/color/{colormaps_reference.py => plot_colormaps_reference.py} (100%) create mode 100644 examples/lines_bars_and_markers/README.txt create mode 100644 examples/pie_and_polar_charts/README.txt diff --git a/doc/conf.py b/doc/conf.py index c88b053b4e50..bbf177af124e 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -32,6 +32,7 @@ 'sphinx.ext.inheritance_diagram', 'sphinx_gallery.gen_gallery', 'sphinxext.gen_rst', + 'sphinxext.gen_gallery', 'matplotlib.sphinxext.plot_directive', 'sphinxext.github', 'numpydoc'] @@ -105,6 +106,7 @@ # path where to save gallery generated examples 'gallery_dirs' : 'auto_examples'} +plot_gallery = True # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] diff --git a/doc/users/image_tutorial.rst b/doc/users/image_tutorial.rst index 1d1f58ee5e82..6fbc4194ce39 100644 --- a/doc/users/image_tutorial.rst +++ b/doc/users/image_tutorial.rst @@ -226,7 +226,7 @@ Note that you can also change colormaps on existing plot objects using the There are many other colormap schemes available. See the `list and images of the colormaps -<../examples/color/colormaps_reference.html>`_. +<../examples/color/plot_colormaps_reference.html>`_. .. _`Color Bars`: diff --git a/doc/users/prev_whats_new/whats_new_1.1.rst b/doc/users/prev_whats_new/whats_new_1.1.rst index 54cd72d80063..d7fda134a626 100644 --- a/doc/users/prev_whats_new/whats_new_1.1.rst +++ b/doc/users/prev_whats_new/whats_new_1.1.rst @@ -205,6 +205,6 @@ Other improvements * Pim Schellart added a new colormap called "cubehelix". Sameer Grover also added a colormap called "coolwarm". See it and all - other colormaps :ref:`here `. + other colormaps :ref:`here `. * Many bug fixes and documentation improvements. diff --git a/doc/users/prev_whats_new/whats_new_1.5.rst b/doc/users/prev_whats_new/whats_new_1.5.rst index a8edf5c3b2db..4085726d8d9e 100644 --- a/doc/users/prev_whats_new/whats_new_1.5.rst +++ b/doc/users/prev_whats_new/whats_new_1.5.rst @@ -109,7 +109,7 @@ You can even multiply cyclers, which is like using `itertools.product()` on two or more property cycles. Remember to use parentheses if writing a multi-line `prop_cycle` parameter. -.. plot:: mpl_examples/color/color_cycle_demo.py +.. plot:: mpl_examples/color/plot_color_cycle.py New Colormaps diff --git a/examples/color/README.txt b/examples/color/README.txt new file mode 100644 index 000000000000..7bd143064172 --- /dev/null +++ b/examples/color/README.txt @@ -0,0 +1,4 @@ +.. _color_examples: + +Color +===== diff --git a/examples/color/color_cycle_demo.py b/examples/color/plot_color_cycle.py similarity index 100% rename from examples/color/color_cycle_demo.py rename to examples/color/plot_color_cycle.py diff --git a/examples/color/color_cycle_default.py b/examples/color/plot_color_cycle_default.py similarity index 100% rename from examples/color/color_cycle_default.py rename to examples/color/plot_color_cycle_default.py diff --git a/examples/color/colormaps_reference.py b/examples/color/plot_colormaps_reference.py similarity index 100% rename from examples/color/colormaps_reference.py rename to examples/color/plot_colormaps_reference.py diff --git a/examples/lines_bars_and_markers/README.txt b/examples/lines_bars_and_markers/README.txt new file mode 100644 index 000000000000..a842344008fa --- /dev/null +++ b/examples/lines_bars_and_markers/README.txt @@ -0,0 +1,4 @@ +.. _lines_bars_and_markers_example: + +Lines, bars and markers +======================= diff --git a/examples/lines_bars_and_markers/scatter_with_legend.py b/examples/lines_bars_and_markers/scatter_with_legend.py index 8f86bc51f8ed..bca9215ef8aa 100644 --- a/examples/lines_bars_and_markers/scatter_with_legend.py +++ b/examples/lines_bars_and_markers/scatter_with_legend.py @@ -1,5 +1,7 @@ ''' -Demo of a scatter plot (scatter) with a legend. +=========================== +Scatter plots with a legend +=========================== Also demonstrates how transparency of the markers can be adjusted by giving ``alpha`` a value between diff --git a/examples/pie_and_polar_charts/README.txt b/examples/pie_and_polar_charts/README.txt new file mode 100644 index 000000000000..31f87c586495 --- /dev/null +++ b/examples/pie_and_polar_charts/README.txt @@ -0,0 +1,4 @@ +.. _pie_and_polar_charts: + +Pie and polar charts +==================== From ba6d2680b49ef40ca092093e7833ed22ef609481 Mon Sep 17 00:00:00 2001 From: Nelle Varoquaux Date: Fri, 10 Mar 2017 21:19:54 -0800 Subject: [PATCH 03/21] DOC added sphinx-gallery as a requirement --- doc-requirements.txt | 1 + doc/README.txt | 3 ++- doc/conf.py | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/doc-requirements.txt b/doc-requirements.txt index 5d3f8759a0a7..9af746509bae 100644 --- a/doc-requirements.txt +++ b/doc-requirements.txt @@ -12,3 +12,4 @@ ipython mock colorspacious pillow +sphinx-gallery diff --git a/doc/README.txt b/doc/README.txt index d88e0b226712..925a91e67f29 100644 --- a/doc/README.txt +++ b/doc/README.txt @@ -21,7 +21,8 @@ All of these dependencies *except graphviz* can be installed through pip:: or all of them via conda and pip:: - conda install sphinx numpydoc ipython mock graphviz pillow + conda install sphinx numpydoc ipython mock graphviz pillow \ + sphinx-gallery pip install colorspacious To build the HTML documentation, type ``python make.py html`` in this diff --git a/doc/conf.py b/doc/conf.py index bbf177af124e..23dda7f9ef3e 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -55,6 +55,12 @@ raise ImportError("No module named numpydoc - you need to install " "numpydoc to build the documentation.") +try: + import sphinx_gallery +except ImportError: + raise ImportError("No module named sphinx-gallery - you need to install " + "numpydoc to build the documentation.") + try: import colorspacious except ImportError: From c908f984d9493ed65fccd63c6382d34df07c6511 Mon Sep 17 00:00:00 2001 From: Nelle Varoquaux Date: Fri, 10 Mar 2017 21:24:09 -0800 Subject: [PATCH 04/21] DOC Added readme files to include examples in SG --- .gitignore | 1 + examples/showcase/README.txt | 4 ++++ examples/style_sheets/README.txt | 4 ++++ examples/text_labels_and_annotations/README.txt | 4 ++++ examples/text_labels_and_annotations/rainbow_text.py | 4 ++++ 5 files changed, 17 insertions(+) create mode 100644 examples/showcase/README.txt create mode 100644 examples/style_sheets/README.txt create mode 100644 examples/text_labels_and_annotations/README.txt diff --git a/.gitignore b/.gitignore index 0c5a23276532..665e53c49fe1 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,7 @@ build # sphinx build directory doc/_build +doc/auto_examples # setup.py dist directory dist # Egg metadata diff --git a/examples/showcase/README.txt b/examples/showcase/README.txt new file mode 100644 index 000000000000..28028ad666a2 --- /dev/null +++ b/examples/showcase/README.txt @@ -0,0 +1,4 @@ +.. _showcase_examples: + +Showcase +======== diff --git a/examples/style_sheets/README.txt b/examples/style_sheets/README.txt new file mode 100644 index 000000000000..671ff3bf3067 --- /dev/null +++ b/examples/style_sheets/README.txt @@ -0,0 +1,4 @@ +.. _style_sheet_examples: + +Style sheets +============ diff --git a/examples/text_labels_and_annotations/README.txt b/examples/text_labels_and_annotations/README.txt new file mode 100644 index 000000000000..565fd8915c86 --- /dev/null +++ b/examples/text_labels_and_annotations/README.txt @@ -0,0 +1,4 @@ +.. _text_labels_and_annotations: + +Text, labels and annotations +============================ diff --git a/examples/text_labels_and_annotations/rainbow_text.py b/examples/text_labels_and_annotations/rainbow_text.py index 95142175ce3d..3a930b4a7c40 100644 --- a/examples/text_labels_and_annotations/rainbow_text.py +++ b/examples/text_labels_and_annotations/rainbow_text.py @@ -1,5 +1,9 @@ # -*- coding: utf-8 -*- """ +============ +Rainbow text +============ + The example shows how to string together several text objects. HISTORY From c61c856f2f37292d5f37c4db7ef0f02c5fbd5c1d Mon Sep 17 00:00:00 2001 From: Nelle Varoquaux Date: Fri, 10 Mar 2017 21:26:30 -0800 Subject: [PATCH 05/21] DOC SG doesn't support parallel builds yet --- .travis.yml | 1 + ci/travis/test_script.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index eac4d4f82e32..2bd4d5ba9ebb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -142,6 +142,7 @@ install: pip install -ve . script: source ci/travis/test_script.sh + before_cache: - rm -rf $HOME/.cache/matplotlib/tex.cache - rm -rf $HOME/.cache/matplotlib/test_cache diff --git a/ci/travis/test_script.sh b/ci/travis/test_script.sh index 21ee11fee066..a978fde101f4 100644 --- a/ci/travis/test_script.sh +++ b/ci/travis/test_script.sh @@ -30,7 +30,7 @@ if [[ $BUILD_DOCS == false ]]; then fi else cd doc - python make.py html -n 2 + python make.py html # We don't build the LaTeX docs here, so linkchecker will complain touch build/html/Matplotlib.pdf # Linkchecker only works with python 2.7 for the time being From eaaf1829e8e23bab8dbac03b14f59412f5886974 Mon Sep 17 00:00:00 2001 From: Nelle Varoquaux Date: Fri, 10 Mar 2017 21:46:53 -0800 Subject: [PATCH 06/21] DOC lines, bars and markers is now full SG --- doc/users/legend_guide.rst | 2 +- doc/users/screenshots.rst | 4 ++-- doc/users/whats_new.rst | 2 +- .../{barh_demo.py => plot_barh.py} | 0 .../{cohere_demo.py => plot_cohere.py} | 0 .../{fill_demo.py => plot_fill.py} | 0 ...ash_control.py => plot_line_demo_dash_control.py} | 0 ...es_reference.py => plot_line_styles_reference.py} | 0 .../{linestyles.py => plot_linestyles.py} | 0 ...ference.py => plot_marker_fillstyle_reference.py} | 0 ...{marker_reference.py => plot_marker_reference.py} | 0 ...ulticolored_line.py => plot_multicolored_line.py} | 0 ...er_with_legend.py => plot_scatter_with_legend.py} | 0 examples/tests/backend_driver.py | 12 ++++++------ lib/matplotlib/axes/_axes.py | 4 ++-- 15 files changed, 12 insertions(+), 12 deletions(-) rename examples/lines_bars_and_markers/{barh_demo.py => plot_barh.py} (100%) rename examples/lines_bars_and_markers/{cohere_demo.py => plot_cohere.py} (100%) rename examples/lines_bars_and_markers/{fill_demo.py => plot_fill.py} (100%) rename examples/lines_bars_and_markers/{line_demo_dash_control.py => plot_line_demo_dash_control.py} (100%) rename examples/lines_bars_and_markers/{line_styles_reference.py => plot_line_styles_reference.py} (100%) rename examples/lines_bars_and_markers/{linestyles.py => plot_linestyles.py} (100%) rename examples/lines_bars_and_markers/{marker_fillstyle_reference.py => plot_marker_fillstyle_reference.py} (100%) rename examples/lines_bars_and_markers/{marker_reference.py => plot_marker_reference.py} (100%) rename examples/lines_bars_and_markers/{multicolored_line.py => plot_multicolored_line.py} (100%) rename examples/lines_bars_and_markers/{scatter_with_legend.py => plot_scatter_with_legend.py} (100%) diff --git a/doc/users/legend_guide.rst b/doc/users/legend_guide.rst index c7fb0621df9f..59686ce70c35 100644 --- a/doc/users/legend_guide.rst +++ b/doc/users/legend_guide.rst @@ -289,8 +289,8 @@ Known examples of using legend Here is a non-exhaustive list of the examples available involving legend being used in various ways: -* :ref:`lines_bars_and_markers-scatter_with_legend` * :ref:`api-plot_legend` +* :ref:`lines_bars_and_markers-plot_scatter_with_legend` * :ref:`pylab_examples-contourf_hatching` * :ref:`pylab_examples-figlegend_demo` * :ref:`pylab_examples-scatter_symbol` diff --git a/doc/users/screenshots.rst b/doc/users/screenshots.rst index d5ab16bb7870..779514b586a0 100644 --- a/doc/users/screenshots.rst +++ b/doc/users/screenshots.rst @@ -103,7 +103,7 @@ command, which includes customizations such as error bars: It's also simple to create stacked bars (`bar_stacked.py <../examples/pylab_examples/bar_stacked.html>`_), or horizontal bar charts -(`barh_demo.py <../examples/lines_bars_and_markers/barh_demo.html>`_). +(`plot_barh.py <../examples/lines_bars_and_markers/plot_barh.html>`_). .. _screenshots_pie_demo: @@ -166,7 +166,7 @@ Fill demo The :func:`~matplotlib.pyplot.fill` command lets you plot filled curves and polygons: -.. plot:: mpl_examples/lines_bars_and_markers/fill_demo.py +.. plot:: mpl_examples/lines_bars_and_markers/plot_fill.py Thanks to Andrew Straw for adding this function. diff --git a/doc/users/whats_new.rst b/doc/users/whats_new.rst index 078eef4e4912..6923a00af092 100644 --- a/doc/users/whats_new.rst +++ b/doc/users/whats_new.rst @@ -287,7 +287,7 @@ Filled ``+`` and ``x`` markers New fillable *plus* and *x* markers have been added. See the :mod:`~matplotlib.markers` module and -:ref:`marker reference ` +:ref:`marker reference ` examples. `rcount` and `ccount` for `plot_surface()` diff --git a/examples/lines_bars_and_markers/barh_demo.py b/examples/lines_bars_and_markers/plot_barh.py similarity index 100% rename from examples/lines_bars_and_markers/barh_demo.py rename to examples/lines_bars_and_markers/plot_barh.py diff --git a/examples/lines_bars_and_markers/cohere_demo.py b/examples/lines_bars_and_markers/plot_cohere.py similarity index 100% rename from examples/lines_bars_and_markers/cohere_demo.py rename to examples/lines_bars_and_markers/plot_cohere.py diff --git a/examples/lines_bars_and_markers/fill_demo.py b/examples/lines_bars_and_markers/plot_fill.py similarity index 100% rename from examples/lines_bars_and_markers/fill_demo.py rename to examples/lines_bars_and_markers/plot_fill.py diff --git a/examples/lines_bars_and_markers/line_demo_dash_control.py b/examples/lines_bars_and_markers/plot_line_demo_dash_control.py similarity index 100% rename from examples/lines_bars_and_markers/line_demo_dash_control.py rename to examples/lines_bars_and_markers/plot_line_demo_dash_control.py diff --git a/examples/lines_bars_and_markers/line_styles_reference.py b/examples/lines_bars_and_markers/plot_line_styles_reference.py similarity index 100% rename from examples/lines_bars_and_markers/line_styles_reference.py rename to examples/lines_bars_and_markers/plot_line_styles_reference.py diff --git a/examples/lines_bars_and_markers/linestyles.py b/examples/lines_bars_and_markers/plot_linestyles.py similarity index 100% rename from examples/lines_bars_and_markers/linestyles.py rename to examples/lines_bars_and_markers/plot_linestyles.py diff --git a/examples/lines_bars_and_markers/marker_fillstyle_reference.py b/examples/lines_bars_and_markers/plot_marker_fillstyle_reference.py similarity index 100% rename from examples/lines_bars_and_markers/marker_fillstyle_reference.py rename to examples/lines_bars_and_markers/plot_marker_fillstyle_reference.py diff --git a/examples/lines_bars_and_markers/marker_reference.py b/examples/lines_bars_and_markers/plot_marker_reference.py similarity index 100% rename from examples/lines_bars_and_markers/marker_reference.py rename to examples/lines_bars_and_markers/plot_marker_reference.py diff --git a/examples/lines_bars_and_markers/multicolored_line.py b/examples/lines_bars_and_markers/plot_multicolored_line.py similarity index 100% rename from examples/lines_bars_and_markers/multicolored_line.py rename to examples/lines_bars_and_markers/plot_multicolored_line.py diff --git a/examples/lines_bars_and_markers/scatter_with_legend.py b/examples/lines_bars_and_markers/plot_scatter_with_legend.py similarity index 100% rename from examples/lines_bars_and_markers/scatter_with_legend.py rename to examples/lines_bars_and_markers/plot_scatter_with_legend.py diff --git a/examples/tests/backend_driver.py b/examples/tests/backend_driver.py index e084e032f9d8..9197800d0665 100644 --- a/examples/tests/backend_driver.py +++ b/examples/tests/backend_driver.py @@ -51,13 +51,13 @@ files = dict() files['lines'] = [ - 'barh_demo.py', - 'cohere_demo.py', - 'fill_demo.py', + 'plot_barh.py', + 'plot_cohere.py', + 'plot_fill.py', 'fill_demo_features.py', - 'line_demo_dash_control.py', - 'line_styles_reference.py', - 'scatter_with_legend.py' + 'plot_line_demo_dash_control.py', + 'plot_line_styles_reference.py', + 'plot_scatter_with_legend.py' ] files['shapes'] = [ diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 8c6c400a2d81..1fac6c9d48ff 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -4699,7 +4699,7 @@ def fill(self, *args, **kwargs): Examples -------- - .. plot:: mpl_examples/lines_bars_and_markers/fill_demo.py + .. plot:: auto_examples/lines_bars_and_markers/plot_fill.py """ @@ -7067,7 +7067,7 @@ def cohere(self, x, y, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none, Examples -------- - .. plot:: mpl_examples/lines_bars_and_markers/cohere_demo.py + .. plot:: auto_examples/lines_bars_and_markers/plot_cohere.py """ if not self._hold: self.cla() From 4f92501d5e5f203e258965ca6e0e8f723a677bd2 Mon Sep 17 00:00:00 2001 From: Nelle Varoquaux Date: Fri, 10 Mar 2017 22:30:45 -0800 Subject: [PATCH 07/21] DOC examples/statistics is fully SG --- doc/users/prev_whats_new/whats_new_1.4.rst | 4 +- doc/users/screenshots.rst | 2 +- examples/README | 44 ++++++++++++++++++ examples/README.txt | 46 ++----------------- examples/statistics/README.txt | 4 ++ .../{boxplot_demo.py => plot_boxplot.py} | 0 ...ot_color_demo.py => plot_boxplot_color.py} | 0 ...olin_demo.py => plot_boxplot_vs_violin.py} | 0 .../statistics/{bxp_demo.py => plot_bxp.py} | 0 ...olin_demo.py => plot_customized_violin.py} | 0 .../{errorbar_demo.py => plot_errorbar.py} | 0 ..._features.py => plot_errorbar_features.py} | 0 ...rbar_limits.py => plot_errorbar_limits.py} | 0 ...d_boxes.py => plot_errorbars_and_boxes.py} | 0 ...lative.py => plot_histogram_cumulative.py} | 0 ...features.py => plot_histogram_features.py} | 0 ...sttypes.py => plot_histogram_histtypes.py} | 0 ...ltihist.py => plot_histogram_multihist.py} | 0 ... plot_multiple_histograms_side_by_side.py} | 0 ...{violinplot_demo.py => plot_violinplot.py} | 0 examples/tests/backend_driver.py | 12 ++--- lib/matplotlib/axes/_axes.py | 11 +++-- 22 files changed, 68 insertions(+), 55 deletions(-) create mode 100644 examples/README create mode 100644 examples/statistics/README.txt rename examples/statistics/{boxplot_demo.py => plot_boxplot.py} (100%) rename examples/statistics/{boxplot_color_demo.py => plot_boxplot_color.py} (100%) rename examples/statistics/{boxplot_vs_violin_demo.py => plot_boxplot_vs_violin.py} (100%) rename examples/statistics/{bxp_demo.py => plot_bxp.py} (100%) rename examples/statistics/{customized_violin_demo.py => plot_customized_violin.py} (100%) rename examples/statistics/{errorbar_demo.py => plot_errorbar.py} (100%) rename examples/statistics/{errorbar_demo_features.py => plot_errorbar_features.py} (100%) rename examples/statistics/{errorbar_limits.py => plot_errorbar_limits.py} (100%) rename examples/statistics/{errorbars_and_boxes.py => plot_errorbars_and_boxes.py} (100%) rename examples/statistics/{histogram_demo_cumulative.py => plot_histogram_cumulative.py} (100%) rename examples/statistics/{histogram_demo_features.py => plot_histogram_features.py} (100%) rename examples/statistics/{histogram_demo_histtypes.py => plot_histogram_histtypes.py} (100%) rename examples/statistics/{histogram_demo_multihist.py => plot_histogram_multihist.py} (100%) rename examples/statistics/{multiple_histograms_side_by_side.py => plot_multiple_histograms_side_by_side.py} (100%) rename examples/statistics/{violinplot_demo.py => plot_violinplot.py} (100%) diff --git a/doc/users/prev_whats_new/whats_new_1.4.rst b/doc/users/prev_whats_new/whats_new_1.4.rst index 51b377f0ee05..b361b605a19c 100644 --- a/doc/users/prev_whats_new/whats_new_1.4.rst +++ b/doc/users/prev_whats_new/whats_new_1.4.rst @@ -82,8 +82,8 @@ with :func:`~matplotlib.Axes.bxp`. Lastly, each artist (e.g., the box, outliers, cap, notches) can now be toggled on or off and their styles can be passed in through individual kwargs. See the examples: -:ref:`statistics-boxplot_demo` and -:ref:`statistics-bxp_demo` +:ref:`statistics-plot_boxplot` and +:ref:`statistics-plot_bxp` Added a bool kwarg, :code:`manage_xticks`, which if False disables the management of the ticks and limits on the x-axis by :func:`~matplotlib.axes.Axes.bxp`. diff --git a/doc/users/screenshots.rst b/doc/users/screenshots.rst index 779514b586a0..1692aad7e024 100644 --- a/doc/users/screenshots.rst +++ b/doc/users/screenshots.rst @@ -32,7 +32,7 @@ Histograms The :func:`~matplotlib.pyplot.hist` command automatically generates histograms and returns the bin counts or probabilities: -.. plot:: mpl_examples/statistics/histogram_demo_features.py +.. plot:: auto_examples/statistics/plot_histogram_features.py .. _screenshots_path_demo: diff --git a/examples/README b/examples/README new file mode 100644 index 000000000000..1e89277d289b --- /dev/null +++ b/examples/README @@ -0,0 +1,44 @@ +Matplotlib examples +=================== + +There are a variety of ways to use Matplotlib, and most of them are +illustrated in the examples in this directory. + +Probably the most common way people use Matplotlib is with the +procedural interface, which follows the MATLAB/IDL/Mathematica approach +of using simple procedures like "plot" or "title" to modify the current +figure. These examples are included in the "pylab_examples" directory. +If you want to write more robust scripts, e.g., for production use or in +a web application server, you will probably want to use the Matplotlib +API for full control. These examples are found in the "api" directory. +Below is a brief description of the different directories found here: + + * animation - Dynamic plots, see the documentation at + http://matplotlib.org/api/animation_api.html + + * api - working with the Matplotlib API directly. + + * axes_grid1 - Examples related to the axes_grid1 toolkit. + + * axisartist - Examples related to the axisartist toolkit. + + * event_handling - How to interact with your figure, mouse presses, + key presses, object picking, etc. + + * misc - Miscellaneous examples. Some demos for loading and working + with record arrays. + + * mplot3d - 3D examples. + + * pylab_examples - The interface to Matplotlib similar to MATLAB. + + * tests - Tests used by Matplotlib developers to check functionality. + (These tests are still sometimes useful, but mostly developers should + use the pytest tests which perform automatic image comparison.) + + * units - Working with unit data and custom types in Matplotlib. + + * user_interfaces - Using Matplotlib in a GUI application, e.g., + Tkinter, wxPython, PyGObject, PyQt widgets. + + * widgets - Examples using interactive widgets. diff --git a/examples/README.txt b/examples/README.txt index 1e89277d289b..10d55859a56d 100644 --- a/examples/README.txt +++ b/examples/README.txt @@ -1,44 +1,8 @@ -Matplotlib examples -=================== +.. _gallery: -There are a variety of ways to use Matplotlib, and most of them are -illustrated in the examples in this directory. +Gallery +======= -Probably the most common way people use Matplotlib is with the -procedural interface, which follows the MATLAB/IDL/Mathematica approach -of using simple procedures like "plot" or "title" to modify the current -figure. These examples are included in the "pylab_examples" directory. -If you want to write more robust scripts, e.g., for production use or in -a web application server, you will probably want to use the Matplotlib -API for full control. These examples are found in the "api" directory. -Below is a brief description of the different directories found here: +Click on any image to see full size image and source code. - * animation - Dynamic plots, see the documentation at - http://matplotlib.org/api/animation_api.html - - * api - working with the Matplotlib API directly. - - * axes_grid1 - Examples related to the axes_grid1 toolkit. - - * axisartist - Examples related to the axisartist toolkit. - - * event_handling - How to interact with your figure, mouse presses, - key presses, object picking, etc. - - * misc - Miscellaneous examples. Some demos for loading and working - with record arrays. - - * mplot3d - 3D examples. - - * pylab_examples - The interface to Matplotlib similar to MATLAB. - - * tests - Tests used by Matplotlib developers to check functionality. - (These tests are still sometimes useful, but mostly developers should - use the pytest tests which perform automatic image comparison.) - - * units - Working with unit data and custom types in Matplotlib. - - * user_interfaces - Using Matplotlib in a GUI application, e.g., - Tkinter, wxPython, PyGObject, PyQt widgets. - - * widgets - Examples using interactive widgets. +.. contents:: diff --git a/examples/statistics/README.txt b/examples/statistics/README.txt new file mode 100644 index 000000000000..5949a1920c02 --- /dev/null +++ b/examples/statistics/README.txt @@ -0,0 +1,4 @@ +.. _statistics_examples: + +Statistics +========== diff --git a/examples/statistics/boxplot_demo.py b/examples/statistics/plot_boxplot.py similarity index 100% rename from examples/statistics/boxplot_demo.py rename to examples/statistics/plot_boxplot.py diff --git a/examples/statistics/boxplot_color_demo.py b/examples/statistics/plot_boxplot_color.py similarity index 100% rename from examples/statistics/boxplot_color_demo.py rename to examples/statistics/plot_boxplot_color.py diff --git a/examples/statistics/boxplot_vs_violin_demo.py b/examples/statistics/plot_boxplot_vs_violin.py similarity index 100% rename from examples/statistics/boxplot_vs_violin_demo.py rename to examples/statistics/plot_boxplot_vs_violin.py diff --git a/examples/statistics/bxp_demo.py b/examples/statistics/plot_bxp.py similarity index 100% rename from examples/statistics/bxp_demo.py rename to examples/statistics/plot_bxp.py diff --git a/examples/statistics/customized_violin_demo.py b/examples/statistics/plot_customized_violin.py similarity index 100% rename from examples/statistics/customized_violin_demo.py rename to examples/statistics/plot_customized_violin.py diff --git a/examples/statistics/errorbar_demo.py b/examples/statistics/plot_errorbar.py similarity index 100% rename from examples/statistics/errorbar_demo.py rename to examples/statistics/plot_errorbar.py diff --git a/examples/statistics/errorbar_demo_features.py b/examples/statistics/plot_errorbar_features.py similarity index 100% rename from examples/statistics/errorbar_demo_features.py rename to examples/statistics/plot_errorbar_features.py diff --git a/examples/statistics/errorbar_limits.py b/examples/statistics/plot_errorbar_limits.py similarity index 100% rename from examples/statistics/errorbar_limits.py rename to examples/statistics/plot_errorbar_limits.py diff --git a/examples/statistics/errorbars_and_boxes.py b/examples/statistics/plot_errorbars_and_boxes.py similarity index 100% rename from examples/statistics/errorbars_and_boxes.py rename to examples/statistics/plot_errorbars_and_boxes.py diff --git a/examples/statistics/histogram_demo_cumulative.py b/examples/statistics/plot_histogram_cumulative.py similarity index 100% rename from examples/statistics/histogram_demo_cumulative.py rename to examples/statistics/plot_histogram_cumulative.py diff --git a/examples/statistics/histogram_demo_features.py b/examples/statistics/plot_histogram_features.py similarity index 100% rename from examples/statistics/histogram_demo_features.py rename to examples/statistics/plot_histogram_features.py diff --git a/examples/statistics/histogram_demo_histtypes.py b/examples/statistics/plot_histogram_histtypes.py similarity index 100% rename from examples/statistics/histogram_demo_histtypes.py rename to examples/statistics/plot_histogram_histtypes.py diff --git a/examples/statistics/histogram_demo_multihist.py b/examples/statistics/plot_histogram_multihist.py similarity index 100% rename from examples/statistics/histogram_demo_multihist.py rename to examples/statistics/plot_histogram_multihist.py diff --git a/examples/statistics/multiple_histograms_side_by_side.py b/examples/statistics/plot_multiple_histograms_side_by_side.py similarity index 100% rename from examples/statistics/multiple_histograms_side_by_side.py rename to examples/statistics/plot_multiple_histograms_side_by_side.py diff --git a/examples/statistics/violinplot_demo.py b/examples/statistics/plot_violinplot.py similarity index 100% rename from examples/statistics/violinplot_demo.py rename to examples/statistics/plot_violinplot.py diff --git a/examples/tests/backend_driver.py b/examples/tests/backend_driver.py index 9197800d0665..8dcf2271677d 100644 --- a/examples/tests/backend_driver.py +++ b/examples/tests/backend_driver.py @@ -76,12 +76,12 @@ ] files['statistics'] = [ - 'errorbar_demo.py', - 'errorbar_demo_features.py', - 'histogram_demo_cumulative.py', - 'histogram_demo_features.py', - 'histogram_demo_histtypes.py', - 'histogram_demo_multihist.py', + 'plot_errorbar.py', + 'plot_errorbar_features.py', + 'plot_histogram_cumulative.py', + 'plot_histogram_features.py', + 'plot_histogram_histtypes.py', + 'plot_histogram_multihist.py', ] files['pie'] = [ diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 1fac6c9d48ff..00fdc1ca62e2 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -2799,7 +2799,8 @@ def errorbar(self, x, y, yerr=None, xerr=None, Examples -------- - .. plot:: mpl_examples/statistics/errorbar_demo.py + .. plot:: auto_examples/statistics/plot_errorbar.py + """ kwargs = cbook.normalize_kwargs(kwargs, _alias_map) # anything that comes in as 'None', drop so the default thing @@ -3270,7 +3271,7 @@ def boxplot(self, x, notch=None, sym=None, vert=None, whis=None, Examples -------- - .. plot:: mpl_examples/statistics/boxplot_demo.py + .. plot:: auto_examples/statistics/plot_boxplot.py """ @@ -3540,7 +3541,7 @@ def bxp(self, bxpstats, positions=None, widths=None, vert=True, Examples -------- - .. plot:: mpl_examples/statistics/bxp_demo.py + .. plot:: auto_examples/statistics/plot_bxp.py """ # lists of artists to be output @@ -6102,7 +6103,7 @@ def hist(self, x, bins=None, range=None, normed=False, weights=None, Examples -------- - .. plot:: mpl_examples/statistics/histogram_demo_features.py + .. plot:: auto_examples/statistics/plot_histogram_features.py """ # Avoid shadowing the builtin. @@ -6486,7 +6487,7 @@ def hist2d(self, x, y, bins=10, range=None, normed=False, weights=None, Examples -------- - .. plot:: mpl_examples/statistics/plot_hist.py + .. plot:: auto_examples/statistics/plot_hist.py """ h, xedges, yedges = np.histogram2d(x, y, bins=bins, range=range, From 40eab47fdbdd6925cded8e7f252a264d9028c33d Mon Sep 17 00:00:00 2001 From: Nelle Varoquaux Date: Fri, 10 Mar 2017 23:17:17 -0800 Subject: [PATCH 08/21] =?UTF-8?q?DOC=20pie=20and=20polar=20charts=20is=20n?= =?UTF-8?q?ow=20full=C2=A0SG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/users/github_stats.rst | 2 +- doc/users/screenshots.rst | 2 +- .../{pie_demo_features.py => plot_pie_features.py} | 0 .../{polar_bar_demo.py => plot_polar_bar.py} | 0 .../{polar_scatter_demo.py => plot_polar_scatter.py} | 0 examples/tests/backend_driver.py | 4 ++-- lib/matplotlib/pyplot.py | 2 +- 7 files changed, 5 insertions(+), 5 deletions(-) rename examples/pie_and_polar_charts/{pie_demo_features.py => plot_pie_features.py} (100%) rename examples/pie_and_polar_charts/{polar_bar_demo.py => plot_polar_bar.py} (100%) rename examples/pie_and_polar_charts/{polar_scatter_demo.py => plot_polar_scatter.py} (100%) diff --git a/doc/users/github_stats.rst b/doc/users/github_stats.rst index e0b9a0ea48f8..a71525d2317c 100644 --- a/doc/users/github_stats.rst +++ b/doc/users/github_stats.rst @@ -1397,7 +1397,7 @@ Issues (889): * :ghissue:`6509`: pylab image_masked is broken * :ghissue:`6657`: appveyor is failing on pre-install * :ghissue:`6610`: Icons for Tk are not antialiased. -* :ghissue:`6687`: Small issues with the example ``polar_scatter_demo.py`` +* :ghissue:`6687`: Small issues with the example ``plot_polar_scatter.py`` * :ghissue:`6541`: Time to deprecate the GTK backend * :ghissue:`6680`: Minor typo in the docstring of ``IdentityTransform``? * :ghissue:`6670`: plt.text object updating incorrectly with blit=False diff --git a/doc/users/screenshots.rst b/doc/users/screenshots.rst index 1692aad7e024..c4cd32a37908 100644 --- a/doc/users/screenshots.rst +++ b/doc/users/screenshots.rst @@ -117,7 +117,7 @@ exploding one or more wedges from the center of the pie, and a shadow effect. Take a close look at the attached code, which generates this figure in just a few lines of code. -.. plot:: mpl_examples/pie_and_polar_charts/pie_demo_features.py +.. plot:: auto_examples/pie_and_polar_charts/plot_pie_features.py .. _screenshots_table_demo: diff --git a/examples/pie_and_polar_charts/pie_demo_features.py b/examples/pie_and_polar_charts/plot_pie_features.py similarity index 100% rename from examples/pie_and_polar_charts/pie_demo_features.py rename to examples/pie_and_polar_charts/plot_pie_features.py diff --git a/examples/pie_and_polar_charts/polar_bar_demo.py b/examples/pie_and_polar_charts/plot_polar_bar.py similarity index 100% rename from examples/pie_and_polar_charts/polar_bar_demo.py rename to examples/pie_and_polar_charts/plot_polar_bar.py diff --git a/examples/pie_and_polar_charts/polar_scatter_demo.py b/examples/pie_and_polar_charts/plot_polar_scatter.py similarity index 100% rename from examples/pie_and_polar_charts/polar_scatter_demo.py rename to examples/pie_and_polar_charts/plot_polar_scatter.py diff --git a/examples/tests/backend_driver.py b/examples/tests/backend_driver.py index 8dcf2271677d..7e269561ce52 100644 --- a/examples/tests/backend_driver.py +++ b/examples/tests/backend_driver.py @@ -86,8 +86,8 @@ files['pie'] = [ 'pie_demo.py', - 'polar_bar_demo.py', - 'polar_scatter_demo.py', + 'plot_polar_bar.py', + 'plot_polar_scatter.py', ] files['text_labels_and_annotations'] = [ diff --git a/lib/matplotlib/pyplot.py b/lib/matplotlib/pyplot.py index 3a8f70f761b6..f3cc40e70d17 100644 --- a/lib/matplotlib/pyplot.py +++ b/lib/matplotlib/pyplot.py @@ -1037,7 +1037,7 @@ def subplot(*args, **kwargs): For additional information on :func:`axes` and :func:`subplot` keyword arguments. - :file:`examples/pie_and_polar_charts/polar_scatter_demo.py` + :file:`auto_examples/pie_and_polar_charts/plot_polar_scatter.py` For an example **Example:** From 973812488fd29ac4c1592a3812809a83fae286fc Mon Sep 17 00:00:00 2001 From: Nelle Varoquaux Date: Sat, 11 Mar 2017 10:38:21 -0800 Subject: [PATCH 09/21] DOC subplots, axes and figures are now full SG --- doc/users/screenshots.rst | 2 +- examples/images_contours_and_fields/README.txt | 4 ++++ examples/subplots_axes_and_figures/README.txt | 4 ++++ ...it_celsius_scales.py => plot_fahrenheit_celsius_scales.py} | 0 .../{subplot_demo.py => plot_subplot.py} | 0 lib/matplotlib/pyplot.py | 2 +- 6 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 examples/images_contours_and_fields/README.txt create mode 100644 examples/subplots_axes_and_figures/README.txt rename examples/subplots_axes_and_figures/{fahrenheit_celsius_scales.py => plot_fahrenheit_celsius_scales.py} (100%) rename examples/subplots_axes_and_figures/{subplot_demo.py => plot_subplot.py} (100%) diff --git a/doc/users/screenshots.rst b/doc/users/screenshots.rst index c4cd32a37908..bc176e34d7e5 100644 --- a/doc/users/screenshots.rst +++ b/doc/users/screenshots.rst @@ -22,7 +22,7 @@ Subplot demo Multiple axes (i.e. subplots) are created with the :func:`~matplotlib.pyplot.subplot` command: -.. plot:: mpl_examples/subplots_axes_and_figures/subplot_demo.py +.. plot:: auto_examples/subplots_axes_and_figures/plot_subplot.py .. _screenshots_histogram_demo: diff --git a/examples/images_contours_and_fields/README.txt b/examples/images_contours_and_fields/README.txt new file mode 100644 index 000000000000..882de6f57c37 --- /dev/null +++ b/examples/images_contours_and_fields/README.txt @@ -0,0 +1,4 @@ +.. _images_contours_and_fields_examples: + +Images, contours and fields +=========================== diff --git a/examples/subplots_axes_and_figures/README.txt b/examples/subplots_axes_and_figures/README.txt new file mode 100644 index 000000000000..4ed26f5ef72f --- /dev/null +++ b/examples/subplots_axes_and_figures/README.txt @@ -0,0 +1,4 @@ +.. _subplots_axes_and_figures_examples: + +Subplots, axes and figures +========================== diff --git a/examples/subplots_axes_and_figures/fahrenheit_celsius_scales.py b/examples/subplots_axes_and_figures/plot_fahrenheit_celsius_scales.py similarity index 100% rename from examples/subplots_axes_and_figures/fahrenheit_celsius_scales.py rename to examples/subplots_axes_and_figures/plot_fahrenheit_celsius_scales.py diff --git a/examples/subplots_axes_and_figures/subplot_demo.py b/examples/subplots_axes_and_figures/plot_subplot.py similarity index 100% rename from examples/subplots_axes_and_figures/subplot_demo.py rename to examples/subplots_axes_and_figures/plot_subplot.py diff --git a/lib/matplotlib/pyplot.py b/lib/matplotlib/pyplot.py index f3cc40e70d17..d4df4880fc75 100644 --- a/lib/matplotlib/pyplot.py +++ b/lib/matplotlib/pyplot.py @@ -1042,7 +1042,7 @@ def subplot(*args, **kwargs): **Example:** - .. plot:: mpl_examples/subplots_axes_and_figures/subplot_demo.py + .. plot:: auto_examples/subplots_axes_and_figures/plot_subplot.py """ # if subplot called without arguments, create subplot(1,1,1) From 8f8d31615863b868d686fce2a7d139af685e158e Mon Sep 17 00:00:00 2001 From: Nelle Varoquaux Date: Sun, 12 Mar 2017 14:52:52 -0700 Subject: [PATCH 10/21] DOC added ticks and spines to sphinx-gallery --- examples/ticks_and_spines/README.txt | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 examples/ticks_and_spines/README.txt diff --git a/examples/ticks_and_spines/README.txt b/examples/ticks_and_spines/README.txt new file mode 100644 index 000000000000..e7869c5a08d1 --- /dev/null +++ b/examples/ticks_and_spines/README.txt @@ -0,0 +1,4 @@ +.. _ticks_and_spines_examples: + +Ticks and spines +================ From 55a584031fde234c8184e4794e064262a52fec16 Mon Sep 17 00:00:00 2001 From: Nelle Varoquaux Date: Thu, 16 Mar 2017 11:28:49 -0700 Subject: [PATCH 11/21] DOC image, contours and fields are fully SG compatible --- doc/users/prev_whats_new/whats_new_1.2.rst | 2 +- doc/users/screenshots.rst | 2 +- .../{contourf_log.py => plot_contourf_log.py} | 0 .../{image_demo_clip_path.py => plot_image_clip_path.py} | 0 .../{image_demo.py => plot_image_demo.py} | 0 .../{interpolation_methods.py => plot_interpolation_methods.py} | 0 .../{pcolormesh_levels.py => plot_pcolormesh_levels.py} | 0 ...{streamplot_demo_features.py => plot_streamplot_features.py} | 0 .../{streamplot_demo_masking.py => plot_streamplot_masking.py} | 0 ...lot_demo_start_points.py => plot_streamplot_start_points.py} | 0 10 files changed, 2 insertions(+), 2 deletions(-) rename examples/images_contours_and_fields/{contourf_log.py => plot_contourf_log.py} (100%) rename examples/images_contours_and_fields/{image_demo_clip_path.py => plot_image_clip_path.py} (100%) rename examples/images_contours_and_fields/{image_demo.py => plot_image_demo.py} (100%) rename examples/images_contours_and_fields/{interpolation_methods.py => plot_interpolation_methods.py} (100%) rename examples/images_contours_and_fields/{pcolormesh_levels.py => plot_pcolormesh_levels.py} (100%) rename examples/images_contours_and_fields/{streamplot_demo_features.py => plot_streamplot_features.py} (100%) rename examples/images_contours_and_fields/{streamplot_demo_masking.py => plot_streamplot_masking.py} (100%) rename examples/images_contours_and_fields/{streamplot_demo_start_points.py => plot_streamplot_start_points.py} (100%) diff --git a/doc/users/prev_whats_new/whats_new_1.2.rst b/doc/users/prev_whats_new/whats_new_1.2.rst index 7f64c1e724c1..91f8e1fdd910 100644 --- a/doc/users/prev_whats_new/whats_new_1.2.rst +++ b/doc/users/prev_whats_new/whats_new_1.2.rst @@ -152,7 +152,7 @@ In addition to simply plotting the streamlines of the vector field, line widths of the streamlines to a separate parameter, such as the speed or local intensity of the vector field. -.. plot:: mpl_examples/images_contours_and_fields/streamplot_demo_features.py +.. plot:: mpl_examples/images_contours_and_fields/plot_streamplot_features.py New hist functionality diff --git a/doc/users/screenshots.rst b/doc/users/screenshots.rst index bc176e34d7e5..3fe6b9274bf8 100644 --- a/doc/users/screenshots.rst +++ b/doc/users/screenshots.rst @@ -71,7 +71,7 @@ a vector field. In addition to simply plotting the streamlines, it allows you to map the colors and/or line widths of streamlines to a separate parameter, such as the speed or local intensity of the vector field. -.. plot:: mpl_examples/images_contours_and_fields/streamplot_demo_features.py +.. plot:: auto_examples/images_contours_and_fields/plot_streamplot_features.py This feature complements the :meth:`~matplotlib.pyplot.quiver` function for plotting vector fields. Thanks to Tom Flannaghan and Tony Yu for adding the diff --git a/examples/images_contours_and_fields/contourf_log.py b/examples/images_contours_and_fields/plot_contourf_log.py similarity index 100% rename from examples/images_contours_and_fields/contourf_log.py rename to examples/images_contours_and_fields/plot_contourf_log.py diff --git a/examples/images_contours_and_fields/image_demo_clip_path.py b/examples/images_contours_and_fields/plot_image_clip_path.py similarity index 100% rename from examples/images_contours_and_fields/image_demo_clip_path.py rename to examples/images_contours_and_fields/plot_image_clip_path.py diff --git a/examples/images_contours_and_fields/image_demo.py b/examples/images_contours_and_fields/plot_image_demo.py similarity index 100% rename from examples/images_contours_and_fields/image_demo.py rename to examples/images_contours_and_fields/plot_image_demo.py diff --git a/examples/images_contours_and_fields/interpolation_methods.py b/examples/images_contours_and_fields/plot_interpolation_methods.py similarity index 100% rename from examples/images_contours_and_fields/interpolation_methods.py rename to examples/images_contours_and_fields/plot_interpolation_methods.py diff --git a/examples/images_contours_and_fields/pcolormesh_levels.py b/examples/images_contours_and_fields/plot_pcolormesh_levels.py similarity index 100% rename from examples/images_contours_and_fields/pcolormesh_levels.py rename to examples/images_contours_and_fields/plot_pcolormesh_levels.py diff --git a/examples/images_contours_and_fields/streamplot_demo_features.py b/examples/images_contours_and_fields/plot_streamplot_features.py similarity index 100% rename from examples/images_contours_and_fields/streamplot_demo_features.py rename to examples/images_contours_and_fields/plot_streamplot_features.py diff --git a/examples/images_contours_and_fields/streamplot_demo_masking.py b/examples/images_contours_and_fields/plot_streamplot_masking.py similarity index 100% rename from examples/images_contours_and_fields/streamplot_demo_masking.py rename to examples/images_contours_and_fields/plot_streamplot_masking.py diff --git a/examples/images_contours_and_fields/streamplot_demo_start_points.py b/examples/images_contours_and_fields/plot_streamplot_start_points.py similarity index 100% rename from examples/images_contours_and_fields/streamplot_demo_start_points.py rename to examples/images_contours_and_fields/plot_streamplot_start_points.py From 9bf91a8dcd23bf86a15ca5fd9ce05d957c3c35da Mon Sep 17 00:00:00 2001 From: Nelle Varoquaux Date: Thu, 16 Mar 2017 11:36:45 -0700 Subject: [PATCH 12/21] DOC showcase are fully SG compatible --- doc/users/prev_whats_new/whats_new_1.3.rst | 2 +- doc/users/screenshots.rst | 2 +- examples/showcase/{anatomy.py => plot_anatomy.py} | 0 ...degrees_by_gender.py => plot_bachelors_degrees_by_gender.py} | 0 examples/showcase/{firefox.py => plot_firefox.py} | 0 examples/showcase/{integral_demo.py => plot_integral.py} | 0 examples/showcase/{mandelbrot.py => plot_mandelbrot.py} | 0 examples/showcase/{xkcd.py => plot_xkcd.py} | 0 8 files changed, 2 insertions(+), 2 deletions(-) rename examples/showcase/{anatomy.py => plot_anatomy.py} (100%) rename examples/showcase/{bachelors_degrees_by_gender.py => plot_bachelors_degrees_by_gender.py} (100%) rename examples/showcase/{firefox.py => plot_firefox.py} (100%) rename examples/showcase/{integral_demo.py => plot_integral.py} (100%) rename examples/showcase/{mandelbrot.py => plot_mandelbrot.py} (100%) rename examples/showcase/{xkcd.py => plot_xkcd.py} (100%) diff --git a/doc/users/prev_whats_new/whats_new_1.3.rst b/doc/users/prev_whats_new/whats_new_1.3.rst index e6372b004d28..9b00c18b101f 100644 --- a/doc/users/prev_whats_new/whats_new_1.3.rst +++ b/doc/users/prev_whats_new/whats_new_1.3.rst @@ -91,7 +91,7 @@ before creating your plot. For really fine control, it is also possible to modify each artist's sketch parameters individually with :meth:`matplotlib.artist.Artist.set_sketch_params`. -.. plot:: mpl_examples/showcase/xkcd.py +.. plot:: auto_examples/showcase/plot_xkcd.py Updated Axes3D.contour methods ------------------------------ diff --git a/doc/users/screenshots.rst b/doc/users/screenshots.rst index 3fe6b9274bf8..4a46f6602374 100644 --- a/doc/users/screenshots.rst +++ b/doc/users/screenshots.rst @@ -278,4 +278,4 @@ XKCD-style sketch plots matplotlib supports plotting in the style of `xkcd `. -.. plot:: mpl_examples/showcase/xkcd.py +.. plot:: mpl_examples/showcase/plot_xkcd.py diff --git a/examples/showcase/anatomy.py b/examples/showcase/plot_anatomy.py similarity index 100% rename from examples/showcase/anatomy.py rename to examples/showcase/plot_anatomy.py diff --git a/examples/showcase/bachelors_degrees_by_gender.py b/examples/showcase/plot_bachelors_degrees_by_gender.py similarity index 100% rename from examples/showcase/bachelors_degrees_by_gender.py rename to examples/showcase/plot_bachelors_degrees_by_gender.py diff --git a/examples/showcase/firefox.py b/examples/showcase/plot_firefox.py similarity index 100% rename from examples/showcase/firefox.py rename to examples/showcase/plot_firefox.py diff --git a/examples/showcase/integral_demo.py b/examples/showcase/plot_integral.py similarity index 100% rename from examples/showcase/integral_demo.py rename to examples/showcase/plot_integral.py diff --git a/examples/showcase/mandelbrot.py b/examples/showcase/plot_mandelbrot.py similarity index 100% rename from examples/showcase/mandelbrot.py rename to examples/showcase/plot_mandelbrot.py diff --git a/examples/showcase/xkcd.py b/examples/showcase/plot_xkcd.py similarity index 100% rename from examples/showcase/xkcd.py rename to examples/showcase/plot_xkcd.py From f50ab00a580234046a202bae931d8d1a47cbd3ea Mon Sep 17 00:00:00 2001 From: Nelle Varoquaux Date: Thu, 16 Mar 2017 11:42:15 -0700 Subject: [PATCH 13/21] DOC text, labels and annotations are fully SG compatible --- .../{accented_text.py => plot_accented_text.py} | 0 .../{autowrap_demo.py => plot_autowrap.py} | 0 .../{rainbow_text.py => plot_rainbow_text.py} | 0 .../{text_alignment.py => plot_text_alignment.py} | 0 .../{text_demo_fontdict.py => plot_text_fontdict.py} | 0 .../{text_rotation.py => plot_text_rotation.py} | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename examples/text_labels_and_annotations/{accented_text.py => plot_accented_text.py} (100%) rename examples/text_labels_and_annotations/{autowrap_demo.py => plot_autowrap.py} (100%) rename examples/text_labels_and_annotations/{rainbow_text.py => plot_rainbow_text.py} (100%) rename examples/text_labels_and_annotations/{text_alignment.py => plot_text_alignment.py} (100%) rename examples/text_labels_and_annotations/{text_demo_fontdict.py => plot_text_fontdict.py} (100%) rename examples/text_labels_and_annotations/{text_rotation.py => plot_text_rotation.py} (100%) diff --git a/examples/text_labels_and_annotations/accented_text.py b/examples/text_labels_and_annotations/plot_accented_text.py similarity index 100% rename from examples/text_labels_and_annotations/accented_text.py rename to examples/text_labels_and_annotations/plot_accented_text.py diff --git a/examples/text_labels_and_annotations/autowrap_demo.py b/examples/text_labels_and_annotations/plot_autowrap.py similarity index 100% rename from examples/text_labels_and_annotations/autowrap_demo.py rename to examples/text_labels_and_annotations/plot_autowrap.py diff --git a/examples/text_labels_and_annotations/rainbow_text.py b/examples/text_labels_and_annotations/plot_rainbow_text.py similarity index 100% rename from examples/text_labels_and_annotations/rainbow_text.py rename to examples/text_labels_and_annotations/plot_rainbow_text.py diff --git a/examples/text_labels_and_annotations/text_alignment.py b/examples/text_labels_and_annotations/plot_text_alignment.py similarity index 100% rename from examples/text_labels_and_annotations/text_alignment.py rename to examples/text_labels_and_annotations/plot_text_alignment.py diff --git a/examples/text_labels_and_annotations/text_demo_fontdict.py b/examples/text_labels_and_annotations/plot_text_fontdict.py similarity index 100% rename from examples/text_labels_and_annotations/text_demo_fontdict.py rename to examples/text_labels_and_annotations/plot_text_fontdict.py diff --git a/examples/text_labels_and_annotations/text_rotation.py b/examples/text_labels_and_annotations/plot_text_rotation.py similarity index 100% rename from examples/text_labels_and_annotations/text_rotation.py rename to examples/text_labels_and_annotations/plot_text_rotation.py From 7c79b12480817ca1aaeb64b7f4f1baaf4d5d2b69 Mon Sep 17 00:00:00 2001 From: Nelle Varoquaux Date: Thu, 16 Mar 2017 11:55:39 -0700 Subject: [PATCH 14/21] DOC tick and spines is now full SG compatible --- examples/ticks_and_spines/{spines_demo.py => plot_spines.py} | 0 .../{spines_demo_dropped.py => plot_spines_dropped.py} | 0 .../{tick-formatters.py => plot_tick-formatters.py} | 0 .../ticks_and_spines/{tick-locators.py => plot_tick-locators.py} | 0 ...tick_labels_from_values.py => plot_tick_labels_from_values.py} | 0 .../{ticklabels_demo_rotation.py => plot_ticklabels_rotation.py} | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename examples/ticks_and_spines/{spines_demo.py => plot_spines.py} (100%) rename examples/ticks_and_spines/{spines_demo_dropped.py => plot_spines_dropped.py} (100%) rename examples/ticks_and_spines/{tick-formatters.py => plot_tick-formatters.py} (100%) rename examples/ticks_and_spines/{tick-locators.py => plot_tick-locators.py} (100%) rename examples/ticks_and_spines/{tick_labels_from_values.py => plot_tick_labels_from_values.py} (100%) rename examples/ticks_and_spines/{ticklabels_demo_rotation.py => plot_ticklabels_rotation.py} (100%) diff --git a/examples/ticks_and_spines/spines_demo.py b/examples/ticks_and_spines/plot_spines.py similarity index 100% rename from examples/ticks_and_spines/spines_demo.py rename to examples/ticks_and_spines/plot_spines.py diff --git a/examples/ticks_and_spines/spines_demo_dropped.py b/examples/ticks_and_spines/plot_spines_dropped.py similarity index 100% rename from examples/ticks_and_spines/spines_demo_dropped.py rename to examples/ticks_and_spines/plot_spines_dropped.py diff --git a/examples/ticks_and_spines/tick-formatters.py b/examples/ticks_and_spines/plot_tick-formatters.py similarity index 100% rename from examples/ticks_and_spines/tick-formatters.py rename to examples/ticks_and_spines/plot_tick-formatters.py diff --git a/examples/ticks_and_spines/tick-locators.py b/examples/ticks_and_spines/plot_tick-locators.py similarity index 100% rename from examples/ticks_and_spines/tick-locators.py rename to examples/ticks_and_spines/plot_tick-locators.py diff --git a/examples/ticks_and_spines/tick_labels_from_values.py b/examples/ticks_and_spines/plot_tick_labels_from_values.py similarity index 100% rename from examples/ticks_and_spines/tick_labels_from_values.py rename to examples/ticks_and_spines/plot_tick_labels_from_values.py diff --git a/examples/ticks_and_spines/ticklabels_demo_rotation.py b/examples/ticks_and_spines/plot_ticklabels_rotation.py similarity index 100% rename from examples/ticks_and_spines/ticklabels_demo_rotation.py rename to examples/ticks_and_spines/plot_ticklabels_rotation.py From 1ed25aa30fe9dfbe2e562bc03b34d6672ee6e6bd Mon Sep 17 00:00:00 2001 From: Nelle Varoquaux Date: Thu, 16 Mar 2017 18:46:15 -0700 Subject: [PATCH 15/21] DOC shapes and collections is now fully SG compatible --- examples/shapes_and_collections/README.txt | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 examples/shapes_and_collections/README.txt diff --git a/examples/shapes_and_collections/README.txt b/examples/shapes_and_collections/README.txt new file mode 100644 index 000000000000..bce3cbe038e3 --- /dev/null +++ b/examples/shapes_and_collections/README.txt @@ -0,0 +1,5 @@ +.. _shapes_and_collections_examples: + + +Shapes and collections +====================== From 8bc4597d73c909753bd95be891adffe8819dc507 Mon Sep 17 00:00:00 2001 From: Nelle Varoquaux Date: Sun, 19 Mar 2017 13:25:16 -0700 Subject: [PATCH 16/21] DOC mplot3d is fully SG-compatible --- doc/mpl_toolkits/index.rst | 2 +- doc/mpl_toolkits/mplot3d/tutorial.rst | 38 +++++++++---------- doc/users/prev_whats_new/whats_new_1.1.rst | 4 +- doc/users/prev_whats_new/whats_new_1.2.rst | 2 +- doc/users/prev_whats_new/whats_new_1.3.rst | 2 +- doc/users/prev_whats_new/whats_new_1.4.rst | 2 +- doc/users/prev_whats_new/whats_new_1.5.rst | 2 +- doc/users/screenshots.rst | 2 +- examples/mplot3d/README.txt | 4 ++ ...ions3d_demo.py => plot_2dcollections3d.py} | 0 .../{bars3d_demo.py => plot_bars3d.py} | 0 .../{contour3d_demo.py => plot_contour3d.py} | 0 ...contour3d_demo2.py => plot_contour3d_2.py} | 0 ...contour3d_demo3.py => plot_contour3d_3.py} | 0 ...{contourf3d_demo.py => plot_contourf3d.py} | 0 ...ntourf3d_demo2.py => plot_contourf3d_2.py} | 0 ...ce.py => plot_custom_shaded_3d_surface.py} | 0 .../{hist3d_demo.py => plot_hist3d.py} | 0 .../{lines3d_demo.py => plot_lines3d.py} | 0 ..._attractor.py => plot_lorenz_attractor.py} | 0 ...ubplots_demo.py => plot_mixed_subplots.py} | 0 .../{offset_demo.py => plot_offset.py} | 0 ...athpatch3d_demo.py => plot_pathpatch3d.py} | 0 .../{polys3d_demo.py => plot_polys3d.py} | 0 .../{quiver3d_demo.py => plot_quiver3d.py} | 0 ...e_axes3d_demo.py => plot_rotate_axes3d.py} | 0 .../{scatter3d_demo.py => plot_scatter3d.py} | 0 .../{subplot3d_demo.py => plot_subplot3d.py} | 0 .../{surface3d_demo.py => plot_surface3d.py} | 0 ...surface3d_demo2.py => plot_surface3d_2.py} | 0 ...surface3d_demo3.py => plot_surface3d_3.py} | 0 ...adial_demo.py => plot_surface3d_radial.py} | 0 .../{text3d_demo.py => plot_text3d.py} | 12 ++++-- ...contour3d_demo.py => plot_tricontour3d.py} | 0 ...ntourf3d_demo.py => plot_tricontourf3d.py} | 0 .../{trisurf3d_demo.py => plot_trisurf3d.py} | 0 ...trisurf3d_demo2.py => plot_trisurf3d_2.py} | 0 .../{wire3d_demo.py => plot_wire3d.py} | 0 ...ation_demo.py => plot_wire3d_animation.py} | 0 ...o_stride.py => plot_wire3d_zero_stride.py} | 0 lib/mpl_toolkits/mplot3d/axes3d.py | 4 +- 41 files changed, 41 insertions(+), 33 deletions(-) create mode 100644 examples/mplot3d/README.txt rename examples/mplot3d/{2dcollections3d_demo.py => plot_2dcollections3d.py} (100%) rename examples/mplot3d/{bars3d_demo.py => plot_bars3d.py} (100%) rename examples/mplot3d/{contour3d_demo.py => plot_contour3d.py} (100%) rename examples/mplot3d/{contour3d_demo2.py => plot_contour3d_2.py} (100%) rename examples/mplot3d/{contour3d_demo3.py => plot_contour3d_3.py} (100%) rename examples/mplot3d/{contourf3d_demo.py => plot_contourf3d.py} (100%) rename examples/mplot3d/{contourf3d_demo2.py => plot_contourf3d_2.py} (100%) rename examples/mplot3d/{custom_shaded_3d_surface.py => plot_custom_shaded_3d_surface.py} (100%) rename examples/mplot3d/{hist3d_demo.py => plot_hist3d.py} (100%) rename examples/mplot3d/{lines3d_demo.py => plot_lines3d.py} (100%) rename examples/mplot3d/{lorenz_attractor.py => plot_lorenz_attractor.py} (100%) rename examples/mplot3d/{mixed_subplots_demo.py => plot_mixed_subplots.py} (100%) rename examples/mplot3d/{offset_demo.py => plot_offset.py} (100%) rename examples/mplot3d/{pathpatch3d_demo.py => plot_pathpatch3d.py} (100%) rename examples/mplot3d/{polys3d_demo.py => plot_polys3d.py} (100%) rename examples/mplot3d/{quiver3d_demo.py => plot_quiver3d.py} (100%) rename examples/mplot3d/{rotate_axes3d_demo.py => plot_rotate_axes3d.py} (100%) rename examples/mplot3d/{scatter3d_demo.py => plot_scatter3d.py} (100%) rename examples/mplot3d/{subplot3d_demo.py => plot_subplot3d.py} (100%) rename examples/mplot3d/{surface3d_demo.py => plot_surface3d.py} (100%) rename examples/mplot3d/{surface3d_demo2.py => plot_surface3d_2.py} (100%) rename examples/mplot3d/{surface3d_demo3.py => plot_surface3d_3.py} (100%) rename examples/mplot3d/{surface3d_radial_demo.py => plot_surface3d_radial.py} (100%) rename examples/mplot3d/{text3d_demo.py => plot_text3d.py} (76%) rename examples/mplot3d/{tricontour3d_demo.py => plot_tricontour3d.py} (100%) rename examples/mplot3d/{tricontourf3d_demo.py => plot_tricontourf3d.py} (100%) rename examples/mplot3d/{trisurf3d_demo.py => plot_trisurf3d.py} (100%) rename examples/mplot3d/{trisurf3d_demo2.py => plot_trisurf3d_2.py} (100%) rename examples/mplot3d/{wire3d_demo.py => plot_wire3d.py} (100%) rename examples/mplot3d/{wire3d_animation_demo.py => plot_wire3d_animation.py} (100%) rename examples/mplot3d/{wire3d_zero_stride.py => plot_wire3d_zero_stride.py} (100%) diff --git a/doc/mpl_toolkits/index.rst b/doc/mpl_toolkits/index.rst index ae4f59b022a4..54ffc11776f4 100644 --- a/doc/mpl_toolkits/index.rst +++ b/doc/mpl_toolkits/index.rst @@ -30,7 +30,7 @@ plotting (scatter, surf, line, mesh) tools. Not the fastest or feature complete 3D library out there, but ships with Matplotlib and thus may be a lighter weight solution for some use cases. -.. plot:: mpl_examples/mplot3d/contourf3d_demo2.py +.. plot:: auto_examples/mplot3d/plot_contourf3d_2.py .. _toolkit_axes_grid1: diff --git a/doc/mpl_toolkits/mplot3d/tutorial.rst b/doc/mpl_toolkits/mplot3d/tutorial.rst index b0cda8661968..a7f2a14871ba 100644 --- a/doc/mpl_toolkits/mplot3d/tutorial.rst +++ b/doc/mpl_toolkits/mplot3d/tutorial.rst @@ -36,7 +36,7 @@ Line plots ==================== .. automethod:: Axes3D.plot -.. plot:: mpl_examples/mplot3d/lines3d_demo.py +.. plot:: auto_examples/mplot3d/plot_lines3d.py .. _scatter3d: @@ -44,7 +44,7 @@ Scatter plots ============= .. automethod:: Axes3D.scatter -.. plot:: mpl_examples/mplot3d/scatter3d_demo.py +.. plot:: auto_examples/mplot3d/plot_scatter3d.py .. _wireframe: @@ -52,7 +52,7 @@ Wireframe plots =============== .. automethod:: Axes3D.plot_wireframe -.. plot:: mpl_examples/mplot3d/wire3d_demo.py +.. plot:: auto_examples/mplot3d/plot_wire3d.py .. _surface: @@ -60,9 +60,9 @@ Surface plots ============= .. automethod:: Axes3D.plot_surface -.. plot:: mpl_examples/mplot3d/surface3d_demo.py -.. plot:: mpl_examples/mplot3d/surface3d_demo2.py -.. plot:: mpl_examples/mplot3d/surface3d_demo3.py +.. plot:: auto_examples/mplot3d/plot_surface3d.py +.. plot:: auto_examples/mplot3d/plot_surface3d_2.py +.. plot:: auto_examples/mplot3d/plot_surface3d_3.py .. _trisurface: @@ -70,7 +70,7 @@ Tri-Surface plots ================= .. automethod:: Axes3D.plot_trisurf -.. plot:: mpl_examples/mplot3d/trisurf3d_demo.py +.. plot:: auto_examples/mplot3d/plot_trisurf3d.py .. _contour3d: @@ -79,9 +79,9 @@ Contour plots ============= .. automethod:: Axes3D.contour -.. plot:: mpl_examples/mplot3d/contour3d_demo.py -.. plot:: mpl_examples/mplot3d/contour3d_demo2.py -.. plot:: mpl_examples/mplot3d/contour3d_demo3.py +.. plot:: auto_examples/mplot3d/plot_contour3d.py +.. plot:: auto_examples/mplot3d/plot_contour3d_2.py +.. plot:: auto_examples/mplot3d/plot_contour3d_3.py .. _contourf3d: @@ -89,8 +89,8 @@ Filled contour plots ==================== .. automethod:: Axes3D.contourf -.. plot:: mpl_examples/mplot3d/contourf3d_demo.py -.. plot:: mpl_examples/mplot3d/contourf3d_demo2.py +.. plot:: auto_examples/mplot3d/plot_contourf3d.py +.. plot:: auto_examples/mplot3d/plot_contourf3d_2.py .. versionadded:: 1.1.0 The feature demoed in the second contourf3d example was enabled as a @@ -102,7 +102,7 @@ Polygon plots ==================== .. automethod:: Axes3D.add_collection3d -.. plot:: mpl_examples/mplot3d/polys3d_demo.py +.. plot:: auto_examples/mplot3d/plot_polys3d.py .. _bar3d: @@ -110,7 +110,7 @@ Bar plots ==================== .. automethod:: Axes3D.bar -.. plot:: mpl_examples/mplot3d/bars3d_demo.py +.. plot:: auto_examples/mplot3d/plot_bars3d.py .. _quiver3d: @@ -118,13 +118,13 @@ Quiver ==================== .. automethod:: Axes3D.quiver -.. plot:: mpl_examples/mplot3d/quiver3d_demo.py +.. plot:: auto_examples/mplot3d/plot_quiver3d.py .. _2dcollections3d: 2D plots in 3D ==================== -.. plot:: mpl_examples/mplot3d/2dcollections3d_demo.py +.. plot:: auto_examples/mplot3d/plot_2dcollections3d.py .. _text3d: @@ -132,7 +132,7 @@ Text ==================== .. automethod:: Axes3D.text -.. plot:: mpl_examples/mplot3d/text3d_demo.py +.. plot:: auto_examples/mplot3d/plot_text3d.py .. _3dsubplots: @@ -146,5 +146,5 @@ in the same figure. Subplotting 3D plots was added in v1.0.0. Earlier version can not do this. -.. plot:: mpl_examples/mplot3d/subplot3d_demo.py -.. plot:: mpl_examples/mplot3d/mixed_subplots_demo.py +.. plot:: auto_examples/mplot3d/plot_subplot3d.py +.. plot:: auto_examples/mplot3d/plot_mixed_subplots.py diff --git a/doc/users/prev_whats_new/whats_new_1.1.rst b/doc/users/prev_whats_new/whats_new_1.1.rst index d7fda134a626..7003d90124e3 100644 --- a/doc/users/prev_whats_new/whats_new_1.1.rst +++ b/doc/users/prev_whats_new/whats_new_1.1.rst @@ -135,12 +135,12 @@ as 2D plotting, Ben Root has made several improvements to the * Ticker offset display added: -.. plot:: mpl_examples/mplot3d/offset_demo.py +.. plot:: auto_examples/mplot3d/plot_offset.py * :meth:`~mpl_toolkits.mplot3d.axes3d.Axes3D.contourf` gains *zdir* and *offset* kwargs. You can now do this: -.. plot:: mpl_examples/mplot3d/contourf3d_demo2.py +.. plot:: auto_examples/mplot3d/plot_contourf3d_2.py Numerix support removed ----------------------- diff --git a/doc/users/prev_whats_new/whats_new_1.2.rst b/doc/users/prev_whats_new/whats_new_1.2.rst index 91f8e1fdd910..50a8fdf89ff3 100644 --- a/doc/users/prev_whats_new/whats_new_1.2.rst +++ b/doc/users/prev_whats_new/whats_new_1.2.rst @@ -61,7 +61,7 @@ Damon McDougall added a new plotting method for the :mod:`~mpl_toolkits.mplot3d` toolkit called :meth:`~mpl_toolkits.mplot3d.axes3d.Axes3D.plot_trisurf`. -.. plot:: mpl_examples/mplot3d/trisurf3d_demo.py +.. plot:: auto_examples/mplot3d/plot_trisurf3d.py Control the lengths of colorbar extensions ------------------------------------------ diff --git a/doc/users/prev_whats_new/whats_new_1.3.rst b/doc/users/prev_whats_new/whats_new_1.3.rst index 9b00c18b101f..cfaa741b550d 100644 --- a/doc/users/prev_whats_new/whats_new_1.3.rst +++ b/doc/users/prev_whats_new/whats_new_1.3.rst @@ -100,7 +100,7 @@ Damon McDougall updated the :meth:`~mpl_toolkits.mplot3d.axes3d.Axes3D.tricontourf` methods to allow 3D contour plots on abitrary unstructured user-specified triangulations. -.. plot:: mpl_examples/mplot3d/tricontour3d_demo.py +.. plot:: auto_examples/mplot3d/plot_tricontour3d.py New eventplot plot type ``````````````````````` diff --git a/doc/users/prev_whats_new/whats_new_1.4.rst b/doc/users/prev_whats_new/whats_new_1.4.rst index b361b605a19c..0789c9e6aa65 100644 --- a/doc/users/prev_whats_new/whats_new_1.4.rst +++ b/doc/users/prev_whats_new/whats_new_1.4.rst @@ -243,7 +243,7 @@ term project. This feature is documented in :func:`~mpl_toolkits.mplot3d.Axes3D. The team members are: Ryan Steve D'Souza, Victor B, xbtsw, Yang Wang, David, Caradec Bisesar and Vlad Vassilovski. -.. plot:: mpl_examples/mplot3d/quiver3d_demo.py +.. plot:: auto_examples/mplot3d/plot_quiver3d.py polar-plot r-tick locations ``````````````````````````` diff --git a/doc/users/prev_whats_new/whats_new_1.5.rst b/doc/users/prev_whats_new/whats_new_1.5.rst index 4085726d8d9e..daaa27aa23e4 100644 --- a/doc/users/prev_whats_new/whats_new_1.5.rst +++ b/doc/users/prev_whats_new/whats_new_1.5.rst @@ -109,7 +109,7 @@ You can even multiply cyclers, which is like using `itertools.product()` on two or more property cycles. Remember to use parentheses if writing a multi-line `prop_cycle` parameter. -.. plot:: mpl_examples/color/plot_color_cycle.py +.. plot:: auto_examples/color/plot_color_cycle.py New Colormaps diff --git a/doc/users/screenshots.rst b/doc/users/screenshots.rst index 4a46f6602374..e64287294cb9 100644 --- a/doc/users/screenshots.rst +++ b/doc/users/screenshots.rst @@ -54,7 +54,7 @@ The mplot3d toolkit (see :ref:`toolkit_mplot3d-tutorial` and :ref:`mplot3d-examples-index`) has support for simple 3d graphs including surface, wireframe, scatter, and bar charts. -.. plot:: mpl_examples/mplot3d/surface3d_demo.py +.. plot:: auto_examples/mplot3d/plot_surface3d.py Thanks to John Porter, Jonathon Taylor, Reinier Heeres, and Ben Root for the `mplot3d` toolkit. This toolkit is included with all standard matplotlib diff --git a/examples/mplot3d/README.txt b/examples/mplot3d/README.txt new file mode 100644 index 000000000000..7a7402f9c8d2 --- /dev/null +++ b/examples/mplot3d/README.txt @@ -0,0 +1,4 @@ +.. _mplot3d_example: + +mplot3d toolkit +=============== diff --git a/examples/mplot3d/2dcollections3d_demo.py b/examples/mplot3d/plot_2dcollections3d.py similarity index 100% rename from examples/mplot3d/2dcollections3d_demo.py rename to examples/mplot3d/plot_2dcollections3d.py diff --git a/examples/mplot3d/bars3d_demo.py b/examples/mplot3d/plot_bars3d.py similarity index 100% rename from examples/mplot3d/bars3d_demo.py rename to examples/mplot3d/plot_bars3d.py diff --git a/examples/mplot3d/contour3d_demo.py b/examples/mplot3d/plot_contour3d.py similarity index 100% rename from examples/mplot3d/contour3d_demo.py rename to examples/mplot3d/plot_contour3d.py diff --git a/examples/mplot3d/contour3d_demo2.py b/examples/mplot3d/plot_contour3d_2.py similarity index 100% rename from examples/mplot3d/contour3d_demo2.py rename to examples/mplot3d/plot_contour3d_2.py diff --git a/examples/mplot3d/contour3d_demo3.py b/examples/mplot3d/plot_contour3d_3.py similarity index 100% rename from examples/mplot3d/contour3d_demo3.py rename to examples/mplot3d/plot_contour3d_3.py diff --git a/examples/mplot3d/contourf3d_demo.py b/examples/mplot3d/plot_contourf3d.py similarity index 100% rename from examples/mplot3d/contourf3d_demo.py rename to examples/mplot3d/plot_contourf3d.py diff --git a/examples/mplot3d/contourf3d_demo2.py b/examples/mplot3d/plot_contourf3d_2.py similarity index 100% rename from examples/mplot3d/contourf3d_demo2.py rename to examples/mplot3d/plot_contourf3d_2.py diff --git a/examples/mplot3d/custom_shaded_3d_surface.py b/examples/mplot3d/plot_custom_shaded_3d_surface.py similarity index 100% rename from examples/mplot3d/custom_shaded_3d_surface.py rename to examples/mplot3d/plot_custom_shaded_3d_surface.py diff --git a/examples/mplot3d/hist3d_demo.py b/examples/mplot3d/plot_hist3d.py similarity index 100% rename from examples/mplot3d/hist3d_demo.py rename to examples/mplot3d/plot_hist3d.py diff --git a/examples/mplot3d/lines3d_demo.py b/examples/mplot3d/plot_lines3d.py similarity index 100% rename from examples/mplot3d/lines3d_demo.py rename to examples/mplot3d/plot_lines3d.py diff --git a/examples/mplot3d/lorenz_attractor.py b/examples/mplot3d/plot_lorenz_attractor.py similarity index 100% rename from examples/mplot3d/lorenz_attractor.py rename to examples/mplot3d/plot_lorenz_attractor.py diff --git a/examples/mplot3d/mixed_subplots_demo.py b/examples/mplot3d/plot_mixed_subplots.py similarity index 100% rename from examples/mplot3d/mixed_subplots_demo.py rename to examples/mplot3d/plot_mixed_subplots.py diff --git a/examples/mplot3d/offset_demo.py b/examples/mplot3d/plot_offset.py similarity index 100% rename from examples/mplot3d/offset_demo.py rename to examples/mplot3d/plot_offset.py diff --git a/examples/mplot3d/pathpatch3d_demo.py b/examples/mplot3d/plot_pathpatch3d.py similarity index 100% rename from examples/mplot3d/pathpatch3d_demo.py rename to examples/mplot3d/plot_pathpatch3d.py diff --git a/examples/mplot3d/polys3d_demo.py b/examples/mplot3d/plot_polys3d.py similarity index 100% rename from examples/mplot3d/polys3d_demo.py rename to examples/mplot3d/plot_polys3d.py diff --git a/examples/mplot3d/quiver3d_demo.py b/examples/mplot3d/plot_quiver3d.py similarity index 100% rename from examples/mplot3d/quiver3d_demo.py rename to examples/mplot3d/plot_quiver3d.py diff --git a/examples/mplot3d/rotate_axes3d_demo.py b/examples/mplot3d/plot_rotate_axes3d.py similarity index 100% rename from examples/mplot3d/rotate_axes3d_demo.py rename to examples/mplot3d/plot_rotate_axes3d.py diff --git a/examples/mplot3d/scatter3d_demo.py b/examples/mplot3d/plot_scatter3d.py similarity index 100% rename from examples/mplot3d/scatter3d_demo.py rename to examples/mplot3d/plot_scatter3d.py diff --git a/examples/mplot3d/subplot3d_demo.py b/examples/mplot3d/plot_subplot3d.py similarity index 100% rename from examples/mplot3d/subplot3d_demo.py rename to examples/mplot3d/plot_subplot3d.py diff --git a/examples/mplot3d/surface3d_demo.py b/examples/mplot3d/plot_surface3d.py similarity index 100% rename from examples/mplot3d/surface3d_demo.py rename to examples/mplot3d/plot_surface3d.py diff --git a/examples/mplot3d/surface3d_demo2.py b/examples/mplot3d/plot_surface3d_2.py similarity index 100% rename from examples/mplot3d/surface3d_demo2.py rename to examples/mplot3d/plot_surface3d_2.py diff --git a/examples/mplot3d/surface3d_demo3.py b/examples/mplot3d/plot_surface3d_3.py similarity index 100% rename from examples/mplot3d/surface3d_demo3.py rename to examples/mplot3d/plot_surface3d_3.py diff --git a/examples/mplot3d/surface3d_radial_demo.py b/examples/mplot3d/plot_surface3d_radial.py similarity index 100% rename from examples/mplot3d/surface3d_radial_demo.py rename to examples/mplot3d/plot_surface3d_radial.py diff --git a/examples/mplot3d/text3d_demo.py b/examples/mplot3d/plot_text3d.py similarity index 76% rename from examples/mplot3d/text3d_demo.py rename to examples/mplot3d/plot_text3d.py index 6b1963e2a43b..d26cf2b74eaf 100644 --- a/examples/mplot3d/text3d_demo.py +++ b/examples/mplot3d/plot_text3d.py @@ -6,10 +6,14 @@ Demonstrates the placement of text annotations on a 3D plot. Functionality shown: -- Using the text function with three types of 'zdir' values: None, - an axis name (ex. 'x'), or a direction tuple (ex. (1, 1, 0)). -- Using the text function with the color keyword. -- Using the text2D function to place text on a fixed position on the ax object. + + - Using the text function with three types of 'zdir' values: None, an axis + name (ex. 'x'), or a direction tuple (ex. (1, 1, 0)). + - Using the text function with the color keyword. + + - Using the text2D function to place text on a fixed position on the ax + object. + ''' from mpl_toolkits.mplot3d import Axes3D diff --git a/examples/mplot3d/tricontour3d_demo.py b/examples/mplot3d/plot_tricontour3d.py similarity index 100% rename from examples/mplot3d/tricontour3d_demo.py rename to examples/mplot3d/plot_tricontour3d.py diff --git a/examples/mplot3d/tricontourf3d_demo.py b/examples/mplot3d/plot_tricontourf3d.py similarity index 100% rename from examples/mplot3d/tricontourf3d_demo.py rename to examples/mplot3d/plot_tricontourf3d.py diff --git a/examples/mplot3d/trisurf3d_demo.py b/examples/mplot3d/plot_trisurf3d.py similarity index 100% rename from examples/mplot3d/trisurf3d_demo.py rename to examples/mplot3d/plot_trisurf3d.py diff --git a/examples/mplot3d/trisurf3d_demo2.py b/examples/mplot3d/plot_trisurf3d_2.py similarity index 100% rename from examples/mplot3d/trisurf3d_demo2.py rename to examples/mplot3d/plot_trisurf3d_2.py diff --git a/examples/mplot3d/wire3d_demo.py b/examples/mplot3d/plot_wire3d.py similarity index 100% rename from examples/mplot3d/wire3d_demo.py rename to examples/mplot3d/plot_wire3d.py diff --git a/examples/mplot3d/wire3d_animation_demo.py b/examples/mplot3d/plot_wire3d_animation.py similarity index 100% rename from examples/mplot3d/wire3d_animation_demo.py rename to examples/mplot3d/plot_wire3d_animation.py diff --git a/examples/mplot3d/wire3d_zero_stride.py b/examples/mplot3d/plot_wire3d_zero_stride.py similarity index 100% rename from examples/mplot3d/wire3d_zero_stride.py rename to examples/mplot3d/plot_wire3d_zero_stride.py diff --git a/lib/mpl_toolkits/mplot3d/axes3d.py b/lib/mpl_toolkits/mplot3d/axes3d.py index 664098934366..1d343786a636 100644 --- a/lib/mpl_toolkits/mplot3d/axes3d.py +++ b/lib/mpl_toolkits/mplot3d/axes3d.py @@ -1911,8 +1911,8 @@ def plot_trisurf(self, *args, **kwargs): **Examples:** - .. plot:: mpl_examples/mplot3d/trisurf3d_demo.py - .. plot:: mpl_examples/mplot3d/trisurf3d_demo2.py + .. plot:: auto_examples/mplot3d/plot_trisurf3d.py + .. plot:: auto_examples/mplot3d/plot_trisurf3d_2.py .. versionadded:: 1.2.0 This plotting function was added for the v1.2.0 release. From d5583f89021b88c1cebdd74cc011bb1cf0645a7c Mon Sep 17 00:00:00 2001 From: Nelle Varoquaux Date: Sun, 19 Mar 2017 14:43:46 -0700 Subject: [PATCH 17/21] DOC The gallery is now built with sphinx-gallery :D --- .gitignore | 1 - doc/_templates/index.html | 5 +- doc/_templates/layout.html | 2 +- doc/conf.py | 2 - doc/devel/contributing.rst | 2 +- doc/sphinxext/gen_gallery.py | 170 ----------------------------------- 6 files changed, 5 insertions(+), 177 deletions(-) delete mode 100644 doc/sphinxext/gen_gallery.py diff --git a/.gitignore b/.gitignore index 665e53c49fe1..ebde87dedfdc 100644 --- a/.gitignore +++ b/.gitignore @@ -59,7 +59,6 @@ lib/matplotlib/mpl-data/matplotlibrc # Documentation generated files # ################################# doc/examples -doc/_templates/gallery.html doc/users/installing.rst doc/_static/matplotlibrc doc/pyplots/tex_demo.png diff --git a/doc/_templates/index.html b/doc/_templates/index.html index 81cbed47a348..4a8b83c29951 100644 --- a/doc/_templates/index.html +++ b/doc/_templates/index.html @@ -75,7 +75,8 @@

Introduction

Matplotlib tries to make easy things easy and hard things possible. You can generate plots, histograms, power spectra, bar charts, errorcharts, scatterplots, etc., with just a few lines of code. - For a sampling, see the screenshots, thumbnail gallery, and + For a sampling, see the screenshots, thumbnail gallery, and examples directory

For simple plotting the pyplot module provides a @@ -99,7 +100,7 @@

Documentation

Trying to learn how to do a particular kind of plot? Check out - the gallery, examples, + the gallery, examples, or the list of plotting commands.

diff --git a/doc/_templates/layout.html b/doc/_templates/layout.html index aa1f278d51b5..3d26e5ba4256 100644 --- a/doc/_templates/layout.html +++ b/doc/_templates/layout.html @@ -39,7 +39,7 @@

{{ _('Navigation') }}

  • home
  • examples
  • -
  • gallery
  • +
  • gallery
  • pyplot
  • docs »
  • diff --git a/doc/conf.py b/doc/conf.py index 23dda7f9ef3e..8e8ac4228066 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -32,7 +32,6 @@ 'sphinx.ext.inheritance_diagram', 'sphinx_gallery.gen_gallery', 'sphinxext.gen_rst', - 'sphinxext.gen_gallery', 'matplotlib.sphinxext.plot_directive', 'sphinxext.github', 'numpydoc'] @@ -251,7 +250,6 @@ # Additional templates that should be rendered to pages, maps page names to # template names. html_additional_pages = {'index': 'index.html', - 'gallery':'gallery.html', 'citing': 'citing.html'} # If false, no module index is generated. diff --git a/doc/devel/contributing.rst b/doc/devel/contributing.rst index 5ec25366c716..b3e2e654e03b 100644 --- a/doc/devel/contributing.rst +++ b/doc/devel/contributing.rst @@ -442,7 +442,7 @@ We have hundreds of examples in subdirectories of :file:`matplotlib/examples`, and these are automatically generated when the website is built to show up both in the `examples <../examples/index.html>`_ and `gallery -<../gallery.html>`_ sections of the website. +<../auto_examples/index.html>`_ sections of the website. Any sample data that the example uses should be kept small and distributed with Matplotlib in the diff --git a/doc/sphinxext/gen_gallery.py b/doc/sphinxext/gen_gallery.py deleted file mode 100644 index 812a0b4ad6ab..000000000000 --- a/doc/sphinxext/gen_gallery.py +++ /dev/null @@ -1,170 +0,0 @@ -# -*- coding: utf-8 -*- -import codecs -import os -import re -import glob -import warnings - -import sphinx.errors - -import matplotlib.image as image - - -exclude_example_sections = ['units'] -multiimage = re.compile('(.*?)(_\d\d){1,2}') - -# generate a thumbnail gallery of examples -gallery_template = u"""\ -{{% extends "layout.html" %}} -{{% set title = "Thumbnail gallery" %}} - - -{{% block body %}} - -

    Click on any image to see full size image and source code

    -
    - -
  • Gallery -
      - {toc} -
    -
  • - -{gallery} - -{{% endblock %}} -""" - -header_template = u"""\ -
    -

    - {title}ΒΆ -

    """ - -link_template = """\ -
    - {basename}
    -
    {title}
    -
    -""" - -toc_template = u"""\ -
  • {title}
  • """ - - -def make_thumbnail(args): - image.thumbnail(args[0], args[1], 0.3) - - -def out_of_date(original, derived): - return (not os.path.exists(derived) or - os.stat(derived).st_mtime < os.stat(original).st_mtime) - - -def gen_gallery(app, doctree): - if app.builder.name not in ('html', 'htmlhelp'): - return - - outdir = app.builder.outdir - rootdir = 'plot_directive/mpl_examples' - - example_sections = list(app.builder.config.mpl_example_sections) - for i, (subdir, title) in enumerate(example_sections): - if subdir in exclude_example_sections: - example_sections.pop(i) - - # images we want to skip for the gallery because they are an unusual - # size that doesn't layout well in a table, or because they may be - # redundant with other images or uninteresting - skips = {'mathtext_examples', - 'matshow_02', - 'matshow_03', - 'matplotlib_icon'} - - thumbnails = {} - rows = [] - toc_rows = [] - - for subdir, title in example_sections: - rows.append(header_template.format(title=title, section=subdir)) - toc_rows.append(toc_template.format(title=title, section=subdir)) - - origdir = os.path.join('build', rootdir, subdir) - thumbdir = os.path.join(outdir, rootdir, subdir, 'thumbnails') - if not os.path.exists(thumbdir): - os.makedirs(thumbdir) - - data = [] - - for filename in sorted(glob.glob(os.path.join(origdir, '*.png'))): - if filename.endswith("hires.png"): - continue - - path, filename = os.path.split(filename) - basename, ext = os.path.splitext(filename) - if basename in skips: - continue - - # Create thumbnails based on images in tmpdir, and place - # them within the build tree - orig_path = str(os.path.join(origdir, filename)) - thumb_path = str(os.path.join(thumbdir, filename)) - if out_of_date(orig_path, thumb_path) or True: - thumbnails[orig_path] = thumb_path - - m = multiimage.match(basename) - if m is not None: - basename = m.group(1) - - data.append((subdir, basename, - os.path.join(rootdir, subdir, 'thumbnails', filename))) - - for (subdir, basename, thumbfile) in data: - if thumbfile is not None: - link = 'examples/%s/%s.html'%(subdir, basename) - rows.append(link_template.format(link=link, - thumb=thumbfile, - basename=basename, - title=basename)) - - if len(data) == 0: - warnings.warn("No thumbnails were found in %s" % subdir) - - # Close out the
    opened up at the top of this loop - rows.append(u"
    ") - - content = gallery_template.format(toc=u'\n'.join(toc_rows), - gallery=u'\n'.join(rows)) - - # Only write out the file if the contents have actually changed. - # Otherwise, this triggers a full rebuild of the docs - - gallery_path = os.path.join(app.builder.srcdir, - '_templates', 'gallery.html') - if os.path.exists(gallery_path): - with codecs.open(gallery_path, 'r', encoding='utf-8') as fh: - regenerate = fh.read() != content - else: - regenerate = True - - if regenerate: - with codecs.open(gallery_path, 'w', encoding='utf-8') as fh: - fh.write(content) - - for key in app.builder.status_iterator( - iter(thumbnails), "generating thumbnails... ", - length=len(thumbnails)): - if out_of_date(key, thumbnails[key]): - image.thumbnail(key, thumbnails[key], 0.3) - - -def setup(app): - app.connect('env-updated', gen_gallery) - - try: # multiple plugins may use mpl_example_sections - app.add_config_value('mpl_example_sections', [], True) - except sphinx.errors.ExtensionError: - pass # mpl_example_sections already defined - - metadata = {'parallel_read_safe': True, 'parallel_write_safe': True} - return metadata From 8f5f185677e20d179e0ba3f4effd1ef19bfa02ef Mon Sep 17 00:00:00 2001 From: Nelle Varoquaux Date: Sun, 19 Mar 2017 14:58:15 -0700 Subject: [PATCH 18/21] DOC all plots in the gallery now produce images --- examples/color/{named_colors.py => plot_named_colors.py} | 0 .../{style_sheets_reference.py => plot_style_sheets_reference.py} | 0 .../{ganged_plots.py => plot_ganged_plots.py} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename examples/color/{named_colors.py => plot_named_colors.py} (100%) rename examples/style_sheets/{style_sheets_reference.py => plot_style_sheets_reference.py} (100%) rename examples/subplots_axes_and_figures/{ganged_plots.py => plot_ganged_plots.py} (100%) diff --git a/examples/color/named_colors.py b/examples/color/plot_named_colors.py similarity index 100% rename from examples/color/named_colors.py rename to examples/color/plot_named_colors.py diff --git a/examples/style_sheets/style_sheets_reference.py b/examples/style_sheets/plot_style_sheets_reference.py similarity index 100% rename from examples/style_sheets/style_sheets_reference.py rename to examples/style_sheets/plot_style_sheets_reference.py diff --git a/examples/subplots_axes_and_figures/ganged_plots.py b/examples/subplots_axes_and_figures/plot_ganged_plots.py similarity index 100% rename from examples/subplots_axes_and_figures/ganged_plots.py rename to examples/subplots_axes_and_figures/plot_ganged_plots.py From 9d805a1246045ba8de46920023f357da43780a84 Mon Sep 17 00:00:00 2001 From: Nelle Varoquaux Date: Sun, 19 Mar 2017 15:15:19 -0700 Subject: [PATCH 19/21] DOC API is now fully SG-compatible --- examples/api/{README => README.txt} | 0 examples/api/plot_patch_collection.py | 2 ++ 2 files changed, 2 insertions(+) rename examples/api/{README => README.txt} (100%) diff --git a/examples/api/README b/examples/api/README.txt similarity index 100% rename from examples/api/README rename to examples/api/README.txt diff --git a/examples/api/plot_patch_collection.py b/examples/api/plot_patch_collection.py index a39ab4ad56a0..d3e6ec5d0556 100644 --- a/examples/api/plot_patch_collection.py +++ b/examples/api/plot_patch_collection.py @@ -2,6 +2,8 @@ ============================ Circles, Wedges and Polygons ============================ + +This example demonstrates how to use patch collections. """ import numpy as np From 4a13444b2ce5f579e762264c4bb6bafe375e8921 Mon Sep 17 00:00:00 2001 From: Nelle Varoquaux Date: Sun, 19 Mar 2017 15:21:11 -0700 Subject: [PATCH 20/21] DOC linking to auto_examples when possible --- doc/users/prev_whats_new/whats_new_1.1.rst | 2 +- doc/users/prev_whats_new/whats_new_1.2.rst | 2 +- doc/users/prev_whats_new/whats_new_1.4.rst | 2 +- doc/users/prev_whats_new/whats_new_1.5.rst | 2 +- doc/users/screenshots.rst | 10 +++++----- lib/matplotlib/axes/_axes.py | 4 ++-- lib/matplotlib/path.py | 2 +- lib/matplotlib/sankey.py | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/doc/users/prev_whats_new/whats_new_1.1.rst b/doc/users/prev_whats_new/whats_new_1.1.rst index 7003d90124e3..d00db765e133 100644 --- a/doc/users/prev_whats_new/whats_new_1.1.rst +++ b/doc/users/prev_whats_new/whats_new_1.1.rst @@ -20,7 +20,7 @@ Kevin Davies has extended Yannick Copin's original Sankey example into a module (:ref:`api-plot_sankey_basics`, :ref:`api-plot_sankey_links`, :ref:`api-plot_sankey_rankine`). -.. plot:: mpl_examples/api/plot_sankey_rankine.py +.. plot:: auto_examples/api/plot_sankey_rankine.py Animation diff --git a/doc/users/prev_whats_new/whats_new_1.2.rst b/doc/users/prev_whats_new/whats_new_1.2.rst index 50a8fdf89ff3..979afc4b1c6b 100644 --- a/doc/users/prev_whats_new/whats_new_1.2.rst +++ b/doc/users/prev_whats_new/whats_new_1.2.rst @@ -152,7 +152,7 @@ In addition to simply plotting the streamlines of the vector field, line widths of the streamlines to a separate parameter, such as the speed or local intensity of the vector field. -.. plot:: mpl_examples/images_contours_and_fields/plot_streamplot_features.py +.. plot:: auto_examples/images_contours_and_fields/plot_streamplot_features.py New hist functionality diff --git a/doc/users/prev_whats_new/whats_new_1.4.rst b/doc/users/prev_whats_new/whats_new_1.4.rst index 0789c9e6aa65..2d77f145c0db 100644 --- a/doc/users/prev_whats_new/whats_new_1.4.rst +++ b/doc/users/prev_whats_new/whats_new_1.4.rst @@ -160,7 +160,7 @@ matplotlib internals were cleaned up to support using such transforms in :class:`~matplotlib.Axes`. This transform is important for some plot types, specifically the Skew-T used in meteorology. -.. plot:: mpl_examples/api/plot_skewt.py +.. plot:: auto_examples/api/plot_skewt.py Support for specifying properties of wedge and text in pie charts. `````````````````````````````````````````````````````````````````` diff --git a/doc/users/prev_whats_new/whats_new_1.5.rst b/doc/users/prev_whats_new/whats_new_1.5.rst index daaa27aa23e4..ed943a243be1 100644 --- a/doc/users/prev_whats_new/whats_new_1.5.rst +++ b/doc/users/prev_whats_new/whats_new_1.5.rst @@ -367,7 +367,7 @@ kwargs names is not ideal, but `Axes.fill_between` already has a This is particularly useful for plotting pre-binned histograms. -.. plot:: mpl_examples/api/plot_filled_step.py +.. plot:: auto_examples/api/plot_filled_step.py Square Plot diff --git a/doc/users/screenshots.rst b/doc/users/screenshots.rst index e64287294cb9..bf1a7039e50b 100644 --- a/doc/users/screenshots.rst +++ b/doc/users/screenshots.rst @@ -43,7 +43,7 @@ Path demo You can add arbitrary paths in matplotlib using the :mod:`matplotlib.path` module: -.. plot:: mpl_examples/shapes_and_collections/plot_path_patch.py +.. plot:: auto_examples/shapes_and_collections/plot_path_patch.py .. _screenshots_mplot3d_surface: @@ -166,7 +166,7 @@ Fill demo The :func:`~matplotlib.pyplot.fill` command lets you plot filled curves and polygons: -.. plot:: mpl_examples/lines_bars_and_markers/plot_fill.py +.. plot:: auto_examples/lines_bars_and_markers/plot_fill.py Thanks to Andrew Straw for adding this function. @@ -178,7 +178,7 @@ Date demo You can plot date data with major and minor ticks and custom tick formatters for both. -.. plot:: mpl_examples/api/plot_date.py +.. plot:: auto_examples/api/plot_date.py See :mod:`matplotlib.ticker` and :mod:`matplotlib.dates` for details and usage. @@ -217,7 +217,7 @@ The :func:`~matplotlib.pyplot.legend` command automatically generates figure legends, with MATLAB-compatible legend placement commands. -.. plot:: mpl_examples/api/plot_legend.py +.. plot:: auto_examples/api/plot_legend.py Thanks to Charles Twardy for input on the legend command. @@ -278,4 +278,4 @@ XKCD-style sketch plots matplotlib supports plotting in the style of `xkcd `. -.. plot:: mpl_examples/showcase/plot_xkcd.py +.. plot:: auto_examples/showcase/plot_xkcd.py diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 00fdc1ca62e2..d1f72a8e0869 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -507,7 +507,7 @@ def legend(self, *args, **kwargs): Examples -------- - .. plot:: mpl_examples/api/plot_legend.py + .. plot:: auto_examples/api/plot_legend.py """ handlers = kwargs.get('handler_map', {}) or {} @@ -3917,7 +3917,7 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None, Examples -------- - .. plot:: mpl_examples/shapes_and_collections/plot_scatter.py + .. plot:: auto_examples/shapes_and_collections/plot_scatter.py """ diff --git a/lib/matplotlib/path.py b/lib/matplotlib/path.py index 7b895db13b2e..cad9be9b1a0f 100644 --- a/lib/matplotlib/path.py +++ b/lib/matplotlib/path.py @@ -317,7 +317,7 @@ def make_compound_path_from_polys(cls, XY): numsides x 2) numpy array of vertices. Return object is a :class:`Path` - .. plot:: mpl_examples/api/plot_histogram_path.py + .. plot:: auto_examples/api/plot_histogram_path.py """ diff --git a/lib/matplotlib/sankey.py b/lib/matplotlib/sankey.py index b5f8fb51696a..c7254cb7b150 100644 --- a/lib/matplotlib/sankey.py +++ b/lib/matplotlib/sankey.py @@ -118,7 +118,7 @@ def __init__(self, ax=None, scale=1.0, unit='', format='%G', gap=0.25, **Examples:** - .. plot:: mpl_examples/api/plot_sankey_basics.py + .. plot:: auto_examples/api/plot_sankey_basics.py """ # Check the arguments. if gap < 0: From 8b764e7d6c20e40a7014939003410079c37ab962 Mon Sep 17 00:00:00 2001 From: Nelle Varoquaux Date: Fri, 24 Mar 2017 18:01:49 -0700 Subject: [PATCH 21/21] DOC FIX nitpicks in the conf file --- doc/conf.py | 5 +++-- lib/matplotlib/axes/_axes.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 8e8ac4228066..fd8ab383c2db 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -57,8 +57,8 @@ try: import sphinx_gallery except ImportError: - raise ImportError("No module named sphinx-gallery - you need to install " - "numpydoc to build the documentation.") + raise ImportError("No module named sphinx_gallery - you need to install " + "sphinx_gallery to build the documentation.") try: import colorspacious @@ -112,6 +112,7 @@ 'gallery_dirs' : 'auto_examples'} plot_gallery = True + # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index d1f72a8e0869..6a4da2a1628d 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -2567,7 +2567,7 @@ def pie(self, x, explode=None, labels=None, colors=None, Examples -------- - .. plot:: mpl_examples/pie_and_polar_charts/pie_demo_features.py + .. plot:: mpl_examples/pie_and_polar_charts/plot_pie_features.py """