diff --git a/doc/_static/mpl.css b/doc/_static/mpl.css
index 9adea6173b47..d94b594cbb07 100644
--- a/doc/_static/mpl.css
+++ b/doc/_static/mpl.css
@@ -786,4 +786,18 @@ div.responsive_subfig img {
width: 50%; /* we want 2 subfigs in a row */
}
+/* Sphinx gallery display */
+}
+
+div.align-center {
+ margin: auto;
+ text-align: center;
+}
+
+p.caption {
+ font-weight: bold;
+}
+
+div#gallery.section {
+ overflow: hidden;
}
diff --git a/doc/_templates/autofunctions.rst b/doc/_templates/autofunctions.rst
new file mode 100644
index 000000000000..2f687e253e55
--- /dev/null
+++ b/doc/_templates/autofunctions.rst
@@ -0,0 +1,19 @@
+
+{{ fullname | escape | underline }}
+
+
+.. currentmodule:: {{ fullname }}
+
+{% block functions %}
+{% if functions %}
+
+Functions
+---------
+
+.. autosummary::
+ :template: autosummary.rst
+ :toctree:
+{% for item in functions %}{% if item not in ['plotting', 'colormaps'] %}
+ {{ item }}{% endif %}{% endfor %}
+{% endif %}
+{% endblock %}
diff --git a/doc/_templates/automodule.rst b/doc/_templates/automodule.rst
new file mode 100644
index 000000000000..9e50ee465090
--- /dev/null
+++ b/doc/_templates/automodule.rst
@@ -0,0 +1,51 @@
+{{ fullname | escape | underline}}
+
+
+.. automodule:: {{ fullname }}
+ :no-members:
+ :no-inherited-members:
+
+{% block functions %}
+{% if functions %}
+
+Classes
+-------
+
+.. autosummary::
+ :template: autosummary.rst
+ :toctree:
+
+{% for item in classes %}
+ {{ item }}
+{% endfor %}
+{% endif %}
+{% endblock %}
+
+{% block exceptions %}
+{% if exceptions %}
+
+Functions
+---------
+
+.. autosummary::
+ :template: autosummary.rst
+ :toctree:
+
+{% for item in functions %}
+ {{ item }}
+{% endfor %}
+{% endif %}
+{% endblock %}
+
+{% block classes %}
+{% if classes %}
+
+Exceptions
+----------
+
+.. autosummary::
+{% for item in exceptions %}
+ {{ item }}
+{%- endfor %}
+{% endif %}
+{% endblock %}
\ No newline at end of file
diff --git a/doc/_templates/autosummary.rst b/doc/_templates/autosummary.rst
new file mode 100644
index 000000000000..cf000cc16de0
--- /dev/null
+++ b/doc/_templates/autosummary.rst
@@ -0,0 +1,16 @@
+{{ fullname | escape | underline}}
+
+
+.. currentmodule:: {{ module }}
+
+.. auto{{ objtype }}:: {{ objname }}
+
+{% if objtype in ['class', 'method', 'function'] %}
+
+.. include:: {{module}}.{{objname}}.examples
+
+.. raw:: html
+
+
{%- block document %}
diff --git a/doc/api/animation_api.rst b/doc/api/animation_api.rst
index 0e6ad7131cc7..46323e15db88 100644
--- a/doc/api/animation_api.rst
+++ b/doc/api/animation_api.rst
@@ -139,17 +139,17 @@ Examples
.. toctree::
:maxdepth: 1
- ../examples/animation/animate_decay
- ../examples/animation/bayes_update
- ../examples/animation/double_pendulum_animated
- ../examples/animation/dynamic_image
- ../examples/animation/histogram
- ../examples/animation/rain
- ../examples/animation/random_data
- ../examples/animation/simple_3danim
- ../examples/animation/simple_anim
- ../examples/animation/strip_chart_demo
- ../examples/animation/unchained
+ ../gallery/animation/animate_decay
+ ../gallery/animation/bayes_update_sgskip
+ ../gallery/animation/double_pendulum_animated_sgskip
+ ../gallery/animation/dynamic_image
+ ../gallery/animation/histogram
+ ../gallery/animation/rain
+ ../gallery/animation/random_data
+ ../gallery/animation/simple_3danim
+ ../gallery/animation/simple_anim
+ ../gallery/animation/strip_chart_demo
+ ../gallery/animation/unchained
``ArtistAnimation``
-------------------
@@ -161,9 +161,9 @@ Examples
.. toctree::
:maxdepth: 1
- ../examples/animation/basic_example
- ../examples/animation/basic_example_writer_sgskip
- ../examples/animation/dynamic_image2
+ ../gallery/animation/basic_example
+ ../gallery/animation/basic_example_writer_sgskip
+ ../gallery/animation/dynamic_image2
diff --git a/doc/api/axes_api.rst b/doc/api/axes_api.rst
index 84556e5b088a..4737c043da12 100644
--- a/doc/api/axes_api.rst
+++ b/doc/api/axes_api.rst
@@ -19,6 +19,7 @@ Basic
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
Axes.plot
@@ -56,6 +57,7 @@ Spans
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
Axes.axhline
@@ -68,6 +70,7 @@ Spectral
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
Axes.acorr
@@ -85,6 +88,7 @@ Statistics
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
Axes.boxplot
@@ -98,6 +102,7 @@ Binned
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
Axes.hexbin
@@ -109,6 +114,7 @@ Contours
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
Axes.clabel
@@ -120,6 +126,7 @@ Array
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
Axes.imshow
@@ -134,6 +141,7 @@ Unstructured Triangles
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
Axes.tripcolor
@@ -147,6 +155,7 @@ Text and Annotations
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
Axes.annotate
@@ -160,6 +169,7 @@ Fields
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
Axes.barbs
@@ -173,6 +183,7 @@ Clearing
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
Axes.cla
@@ -185,6 +196,7 @@ Appearance
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
@@ -215,6 +227,7 @@ Property cycle
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
Axes.set_prop_cycle
@@ -226,6 +239,7 @@ Axis / limits
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
@@ -239,6 +253,7 @@ Axis Limits and direction
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
Axes.invert_xaxis
@@ -265,6 +280,7 @@ Axis Labels, title, and legend
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
Axes.get_xlabel
@@ -285,6 +301,7 @@ Axis scales
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
Axes.set_xscale
@@ -300,6 +317,7 @@ Autoscaling and margins
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
Axes.use_sticky_edges
@@ -328,6 +346,7 @@ Aspect ratio
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
Axes.apply_aspect
@@ -344,6 +363,7 @@ Ticks and tick labels
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
Axes.xaxis_date
@@ -385,6 +405,7 @@ Units
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
Axes.convert_xunits
@@ -397,6 +418,7 @@ Adding Artists
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
Axes.add_artist
@@ -413,6 +435,7 @@ Twinning
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
Axes.twinx
@@ -426,6 +449,7 @@ Axes Position
=============
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
Axes.get_anchor
@@ -445,6 +469,7 @@ Async/Event based
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
Axes.stale
@@ -458,6 +483,7 @@ Interactive
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
@@ -502,6 +528,7 @@ Children
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
Axes.get_children
@@ -515,6 +542,7 @@ Drawing
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
Axes.draw
@@ -534,6 +562,7 @@ Bulk property manipulation
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
Axes.set
@@ -547,6 +576,7 @@ General Artist Properties
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
Axes.set_alpha
@@ -595,6 +625,7 @@ Artist Methods
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
Axes.is_figure_set
@@ -610,6 +641,7 @@ non-rectilinear Axes.
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
Axes.name
@@ -629,6 +661,7 @@ Other
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
Axes.zorder
diff --git a/doc/api/axis_api.rst b/doc/api/axis_api.rst
index 67eb83a16313..01dd873e495b 100644
--- a/doc/api/axis_api.rst
+++ b/doc/api/axis_api.rst
@@ -27,6 +27,7 @@ Inheritance
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
Axis.cla
@@ -38,6 +39,7 @@ Formatters and Locators
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
Axis.get_major_formatter
@@ -55,6 +57,7 @@ Axis Label
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
Axis.set_label_coords
@@ -68,6 +71,7 @@ Ticks, tick labels and Offset text
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
Axis.get_major_ticks
@@ -100,6 +104,7 @@ Data and view internvals
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
Axis.get_data_interval
@@ -112,6 +117,7 @@ Rendering helpers
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
Axis.get_minpos
@@ -125,6 +131,7 @@ Interactive
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
@@ -137,6 +144,7 @@ Units
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
Axis.convert_units
@@ -150,6 +158,7 @@ Incremental navigation
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
Axis.pan
@@ -161,6 +170,7 @@ YAxis Specific
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
YAxis.axis_name
@@ -176,6 +186,7 @@ XAxis Specific
--------------
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
XAxis.axis_name
@@ -191,6 +202,7 @@ Other
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
@@ -211,6 +223,7 @@ not used together may de-couple your tick labels from your data.
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
Axis.set_ticklabels
@@ -228,6 +241,7 @@ not used together may de-couple your tick labels from your data.
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
@@ -252,6 +266,7 @@ Common and inherited methods
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
XTick.apply_tickdir
@@ -274,6 +289,7 @@ YTick
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
YTick.apply_tickdir
@@ -293,6 +309,7 @@ YAxis
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
@@ -360,6 +377,7 @@ YAxis
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
@@ -431,6 +449,7 @@ Ticks
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
@@ -650,6 +669,7 @@ Axis
.. autosummary::
:toctree: _as_gen
+ :template: autosummary.rst
:nosignatures:
diff --git a/doc/api/colors_api.rst b/doc/api/colors_api.rst
index bd577af02ed4..2789e4361370 100644
--- a/doc/api/colors_api.rst
+++ b/doc/api/colors_api.rst
@@ -9,7 +9,45 @@ For a visual representation of the matplotlib colormaps, see the
:mod:`matplotlib.colors`
========================
+.. currentmodule:: matplotlib.colors
+
.. automodule:: matplotlib.colors
- :members:
- :undoc-members:
- :show-inheritance:
+ :no-members:
+ :no-inherited-members:
+
+Classes
+-------
+
+.. autosummary::
+ :toctree: _as_gen/
+ :template: autosummary.rst
+
+ BoundaryNorm
+ Colormap
+ LightSource
+ LinearSegmentedColormap
+ ListedColormap
+ LogNorm
+ NoNorm
+ Normalize
+ PowerNorm
+ SymLogNorm
+
+Functions
+---------
+
+.. autosummary::
+ :toctree: _as_gen/
+ :template: autosummary.rst
+
+ from_levels_and_colors
+ hsv_to_rgb
+ rgb_to_hsv
+ to_hex
+ to_rgb
+ to_rgba
+ to_rgba_array
+ is_color_like
+ makeMappingArray
+ get_named_colors_mapping
+
diff --git a/doc/api/figure_api.rst b/doc/api/figure_api.rst
index 27e86a1fee14..779f4ad1c1c4 100644
--- a/doc/api/figure_api.rst
+++ b/doc/api/figure_api.rst
@@ -6,7 +6,29 @@ figure
:mod:`matplotlib.figure`
========================
+.. currentmodule:: matplotlib.figure
+
.. automodule:: matplotlib.figure
- :members:
- :undoc-members:
- :show-inheritance:
+ :no-members:
+ :no-inherited-members:
+
+Classes
+-------
+
+.. autosummary::
+ :toctree: _as_gen/
+ :template: autosummary.rst
+
+ AxesStack
+ Figure
+ SubplotParams
+
+Functions
+---------
+
+.. autosummary::
+ :toctree: _as_gen/
+ :template: autosummary.rst
+
+ figaspect
+
\ No newline at end of file
diff --git a/doc/api/gridspec_api.rst b/doc/api/gridspec_api.rst
index d4771f02ebdd..133ffed6ac35 100644
--- a/doc/api/gridspec_api.rst
+++ b/doc/api/gridspec_api.rst
@@ -2,11 +2,23 @@
gridspec
********
-
:mod:`matplotlib.gridspec`
==========================
+.. currentmodule:: matplotlib.gridspec
+
.. automodule:: matplotlib.gridspec
- :members:
- :undoc-members:
- :show-inheritance:
+ :no-members:
+ :no-inherited-members:
+
+Classes
+-------
+
+.. autosummary::
+ :toctree: _as_gen/
+ :template: autosummary.rst
+
+ GridSpec
+ SubplotSpec
+ GridSpecBase
+ GridSpecFromSubplotSpec
diff --git a/doc/api/index.rst b/doc/api/index.rst
index 5fb6ed88807c..70a4f47c3576 100644
--- a/doc/api/index.rst
+++ b/doc/api/index.rst
@@ -44,7 +44,6 @@
path_api.rst
patheffects_api.rst
projections_api.rst
- pyplot_api.rst
rcsetup_api.rst
sankey_api.rst
scale_api.rst
@@ -58,3 +57,11 @@
type1font.rst
units_api.rst
widgets_api.rst
+
+.. currentmodule:: matplotlib
+
+.. autosummary::
+ :toctree: _as_gen
+ :template: autofunctions.rst
+
+ pyplot
diff --git a/doc/api/lines_api.rst b/doc/api/lines_api.rst
index 46b7a3bfe58d..01cd114e64c8 100644
--- a/doc/api/lines_api.rst
+++ b/doc/api/lines_api.rst
@@ -4,9 +4,30 @@ lines
:mod:`matplotlib.lines`
-=======================
+========================
+
+.. currentmodule:: matplotlib.lines
.. automodule:: matplotlib.lines
- :members:
- :undoc-members:
- :show-inheritance:
+ :no-members:
+ :no-inherited-members:
+
+Classes
+-------
+
+.. autosummary::
+ :toctree: _as_gen/
+ :template: autosummary.rst
+
+ Line2D
+ VertexSelector
+
+Functions
+---------
+
+.. autosummary::
+ :toctree: _as_gen/
+ :template: autosummary.rst
+
+ segment_hits
+
\ No newline at end of file
diff --git a/doc/api/markers_api.rst b/doc/api/markers_api.rst
index 291cca259734..1b52bbacf57f 100644
--- a/doc/api/markers_api.rst
+++ b/doc/api/markers_api.rst
@@ -6,7 +6,17 @@ markers
:mod:`matplotlib.markers`
=========================
+.. currentmodule:: matplotlib.markers
+
.. automodule:: matplotlib.markers
- :members:
- :undoc-members:
- :show-inheritance:
+ :no-members:
+ :no-inherited-members:
+
+Classes
+-------
+
+.. autosummary::
+ :toctree: _as_gen/
+ :template: autosummary.rst
+
+ MarkerStyle
diff --git a/doc/api/patches_api.rst b/doc/api/patches_api.rst
index fabd77545650..167e7a42c871 100644
--- a/doc/api/patches_api.rst
+++ b/doc/api/patches_api.rst
@@ -6,7 +6,47 @@ patches
:mod:`matplotlib.patches`
=========================
+.. currentmodule:: matplotlib.patches
+
.. automodule:: matplotlib.patches
- :members:
- :undoc-members:
- :show-inheritance:
+ :no-members:
+ :no-inherited-members:
+
+Classes
+-------
+
+.. autosummary::
+ :toctree: _as_gen/
+ :template: autosummary.rst
+
+ Arc
+ Arrow
+ ArrowStyle
+ BoxStyle
+ Circle
+ CirclePolygon
+ ConnectionPatch
+ ConnectionStyle
+ Ellipse
+ FancyArrow
+ FancyArrowPatch
+ FancyBboxPatch
+ Patch
+ PathPatch
+ Polygon
+ Rectangle
+ RegularPolygon
+ Shadow
+ Wedge
+ YAArrow
+
+Functions
+---------
+
+.. autosummary::
+ :toctree: _as_gen/
+ :template: autosummary.rst
+
+ bbox_artist
+ draw_bbox
+
diff --git a/doc/api/pyplot_api.rst b/doc/api/pyplot_api.rst
deleted file mode 100644
index 94e3baac26f0..000000000000
--- a/doc/api/pyplot_api.rst
+++ /dev/null
@@ -1,13 +0,0 @@
-******
-pyplot
-******
-
-
-:mod:`matplotlib.pyplot`
-========================
-
-.. automodule:: matplotlib.pyplot
- :members:
- :undoc-members:
- :show-inheritance:
- :exclude-members: plotting, colormaps
diff --git a/doc/conf.py b/doc/conf.py
index fa3acd05d5a0..3ecdff7de1e0 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -31,7 +31,6 @@
'sphinx.ext.doctest', 'sphinx.ext.autosummary',
'sphinx.ext.inheritance_diagram',
'sphinx_gallery.gen_gallery',
- 'sphinxext.gen_rst',
'matplotlib.sphinxext.plot_directive',
'sphinxext.github',
'numpydoc']
@@ -113,7 +112,7 @@
'reference_url': {'matplotlib': None,
'numpy': 'http://docs.scipy.org/doc/numpy/reference',
'scipy': 'http://docs.scipy.org/doc/scipy/reference'},
- 'backreferences_dir': False,
+ 'backreferences_dir': 'api/_as_gen'
}
plot_gallery = True
diff --git a/doc/contents.rst b/doc/contents.rst
index 794433988854..77585cd00d08 100644
--- a/doc/contents.rst
+++ b/doc/contents.rst
@@ -21,7 +21,6 @@ Overview
resources/index.rst
thirdpartypackages/index.rst
devel/index.rst
- examples/index.rst
glossary/index.rst
.. htmlonly::
diff --git a/doc/devel/contributing.rst b/doc/devel/contributing.rst
index cfa46f45661f..616c235a3e6d 100644
--- a/doc/devel/contributing.rst
+++ b/doc/devel/contributing.rst
@@ -440,9 +440,8 @@ Writing examples
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/index.html>`_ sections of the website.
+when the website is built to show up in the `examples
+<../gallery/index.html>` section of the website.
Any sample data that the example uses should be kept small and
distributed with Matplotlib in the
diff --git a/doc/faq/howto_faq.rst b/doc/faq/howto_faq.rst
index 6ef6851af336..4849bc543448 100644
--- a/doc/faq/howto_faq.rst
+++ b/doc/faq/howto_faq.rst
@@ -230,10 +230,14 @@ the left of the canvas over; see :ref:`event-handling-tutorial`.
Here is an example that gets a bounding box in relative figure coordinates
(0..1) of each of the labels and uses it to move the left of the subplots
-over so that the tick labels fit in the figure
+over so that the tick labels fit in the figure:
-.. plot:: mpl_examples/pyplots/auto_subplots_adjust.py
- :include-source:
+.. figure:: ../gallery/pyplots/images/sphx_glr_auto_subplots_adjust_001.png
+ :target: ../gallery/pyplots/auto_subplots_adjust.html
+ :align: center
+ :scale: 50
+
+ Auto Subplots Adjust
.. _howto-ticks:
@@ -275,8 +279,12 @@ behavior by specifying the coordinates of the label. The example
below shows the default behavior in the left subplots, and the manual
setting in the right subplots.
-.. plot:: mpl_examples/pyplots/align_ylabels.py
- :include-source:
+.. figure:: ../gallery/pyplots/images/sphx_glr_align_ylabels_001.png
+ :target: ../gallery/pyplots/align_ylabels.html
+ :align: center
+ :scale: 50
+
+ Align Ylabels
.. _date-index-plots:
@@ -750,3 +758,4 @@ reference page `_)::
development, interactive scripting, and publication-quality image
generation across user interfaces and operating systems.},
Bdsk-Url-1 = {http://gateway.isiknowledge.com/gateway/Gateway.cgi?GWVersion=2&SrcAuth=Alerting&SrcApp=Alerting&DestApp=WOS&DestLinkType=FullRecord;KeyUT=000245668100019}}
+
diff --git a/doc/mpl_toolkits/axes_grid1/overview.rst b/doc/mpl_toolkits/axes_grid1/overview.rst
index d86278e2896e..3b0fd76c3486 100644
--- a/doc/mpl_toolkits/axes_grid1/overview.rst
+++ b/doc/mpl_toolkits/axes_grid1/overview.rst
@@ -35,7 +35,12 @@ data (e.g., different y-scale) in a same Axes. `AnchoredArtists`_
includes custom artists which are placed at some anchored position,
like the legend.
-.. plot:: mpl_toolkits/axes_grid1/examples/demo_axes_grid.py
+.. figure:: ../../gallery/axes_grid1/images/sphx_glr_demo_axes_grid_001.png
+ :target: ../../gallery/axes_grid1/demo_axes_grid.html
+ :align: center
+ :scale: 50
+
+ Demo Axes Grid
axes_grid1
@@ -52,8 +57,12 @@ ratio. For example, displaying images of a same size with some fixed
padding between them cannot be easily done in matplotlib. ImageGrid is
used in such case.
-.. plot:: mpl_toolkits/axes_grid1/examples/simple_axesgrid.py
- :include-source:
+.. figure:: ../../gallery/axes_grid1/images/sphx_glr_simple_axesgrid_001.png
+ :target: ../../gallery/axes_grid1/simple_axesgrid.html
+ :align: center
+ :scale: 50
+
+ Simple Axesgrid
* The position of each axes is determined at the drawing time (see
`AxesDivider`_), so that the size of the entire grid fits in the
@@ -154,7 +163,12 @@ attribute.
The examples below show what you can do with ImageGrid.
-.. plot:: mpl_toolkits/axes_grid1/examples/demo_axes_grid.py
+.. figure:: ../../gallery/axes_grid1/images/sphx_glr_demo_axes_grid_001.png
+ :target: ../../gallery/axes_grid1/demo_axes_grid.html
+ :align: center
+ :scale: 50
+
+ Demo Axes Grid
AxesDivider
@@ -185,8 +199,12 @@ creates a new axes on the given side of ("top", "right", "bottom" and
colorbar whose height (or width) in sync with the master axes
-------------------------------------------------------------
-.. plot:: mpl_toolkits/axes_grid1/figures/simple_colorbar.py
- :include-source:
+.. figure:: ../../gallery/axes_grid1/images/sphx_glr_simple_colorbar_001.png
+ :target: ../../gallery/axes_grid1/simple_colorbar.html
+ :align: center
+ :scale: 50
+
+ Simple Colorbar
@@ -215,7 +233,12 @@ The "scatter_hist.py" example in mpl can be rewritten using
See the full source code below.
-.. plot:: mpl_toolkits/axes_grid1/examples/scatter_hist.py
+.. figure:: ../../gallery/axes_grid1/images/sphx_glr_scatter_hist_001.png
+ :target: ../../gallery/axes_grid1/scatter_hist.html
+ :align: center
+ :scale: 50
+
+ Scatter Hist
The scatter_hist using the AxesDivider has some advantage over the
@@ -250,8 +273,12 @@ parasite axes. To create a host axes, you may use *host_suplot* or
Example 1. twinx
~~~~~~~~~~~~~~~~
-.. plot:: mpl_toolkits/axes_grid1/figures/parasite_simple.py
- :include-source:
+.. figure:: ../../gallery/axes_grid1/images/sphx_glr_parasite_simple_001.png
+ :target: ../../gallery/axes_grid1/parasite_simple.html
+ :align: center
+ :scale: 50
+
+ Parasite Simple
Example 2. twin
~~~~~~~~~~~~~~~
@@ -267,7 +294,12 @@ tick-formatter for bottom(or left)-axis. ::
r"$\pi$", r"$\frac{3}{2}\pi$", r"$2\pi$"])
-.. plot:: mpl_toolkits/axes_grid1/examples/simple_axisline4.py
+.. figure:: ../../gallery/axes_grid1/images/sphx_glr_simple_axisline4_001.png
+ :target: ../../gallery/axes_grid1/simple_axisline4.html
+ :align: center
+ :scale: 50
+
+ Simple Axisline4
@@ -276,7 +308,12 @@ x-limit in the host axes, the x-limit of the parasite axes will change
accordingly.
-.. plot:: mpl_toolkits/axes_grid1/examples/parasite_simple2.py
+.. figure:: ../../gallery/axes_grid1/images/sphx_glr_parasite_simple2_001.png
+ :target: ../../gallery/axes_grid1/parasite_simple2.html
+ :align: center
+ :scale: 50
+
+ Parasite Simple2
AnchoredArtists
@@ -289,8 +326,12 @@ limited support for an arbitrary transform. For example, the ellipse
in the example below will have width and height in the data
coordinate.
-.. plot:: mpl_toolkits/axes_grid1/examples/simple_anchored_artists.py
- :include-source:
+.. figure:: ../../gallery/axes_grid1/images/sphx_glr_simple_anchored_artists_001.png
+ :target: ../../gallery/axes_grid1/simple_anchored_artists.html
+ :align: center
+ :scale: 50
+
+ Simple Anchored Artists
InsetLocator
@@ -323,7 +364,12 @@ some factor. For example, ::
creates an inset axes whose data scale is half of the parent axes.
Here is complete examples.
-.. plot:: mpl_toolkits/axes_grid1/examples/inset_locator_demo.py
+.. figure:: ../../gallery/axes_grid1/images/sphx_glr_inset_locator_demo_001.png
+ :target: ../../gallery/axes_grid1/inset_locator_demo.html
+ :align: center
+ :scale: 50
+
+ Inset Locator Demo
For example, :func:`zoomed_inset_axes` can be used when you want the
inset represents the zoom-up of the small portion in the parent axes.
@@ -331,8 +377,12 @@ And :mod:`~mpl_toolkits/axes_grid/inset_locator` provides a helper
function :func:`mark_inset` to mark the location of the area
represented by the inset axes.
-.. plot:: mpl_toolkits/axes_grid1/examples/inset_locator_demo2.py
- :include-source:
+.. figure:: ../../gallery/axes_grid1/images/sphx_glr_inset_locator_demo2_001.png
+ :target: ../../gallery/axes_grid1/inset_locator_demo2.html
+ :align: center
+ :scale: 50
+
+ Inset Locator Demo2
RGB Axes
@@ -353,4 +403,22 @@ yaxis of each axes are shared. ::
origin="lower", interpolation="nearest")
-.. plot:: mpl_toolkits/axes_grid1/figures/simple_rgb.py
+.. figure:: ../../gallery/axes_grid1/images/sphx_glr_simple_rgb_001.png
+ :target: ../../gallery/axes_grid1/simple_rgb.html
+ :align: center
+ :scale: 50
+
+ Simple Rgb
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/doc/mpl_toolkits/axes_grid1/users/axes_divider.rst b/doc/mpl_toolkits/axes_grid1/users/axes_divider.rst
index 830cee84ef73..17eebc300fc8 100644
--- a/doc/mpl_toolkits/axes_grid1/users/axes_divider.rst
+++ b/doc/mpl_toolkits/axes_grid1/users/axes_divider.rst
@@ -82,11 +82,22 @@ may consider it as [0:2, 1].
See the example,
-.. plot:: mpl_toolkits/axes_grid1/figures/simple_axes_divider2.py
- :include-source:
+.. figure:: ../../../gallery/axes_grid1/images/sphx_glr_simple_axes_divider2_001.png
+ :target: ../../../gallery/axes_grid1/simple_axes_divider2.html
+ :align: center
+ :scale: 50
+
+ Simple Axes Divider2
You can adjust the size of the each axes according to their x or y
data limits (AxesX and AxesY), similar to the axes aspect parameter.
-.. plot:: mpl_toolkits/axes_grid1/figures/simple_axes_divider3.py
- :include-source:
+.. figure:: ../../../gallery/axes_grid1/images/sphx_glr_simple_axes_divider3_001.png
+ :target: ../../../gallery/axes_grid1/simple_axes_divider3.html
+ :align: center
+ :scale: 50
+
+ Simple Axes Divider3
+
+
+
diff --git a/doc/mpl_toolkits/axisartist/overview.rst b/doc/mpl_toolkits/axisartist/overview.rst
index fc59e0562389..80ad27d041bf 100644
--- a/doc/mpl_toolkits/axisartist/overview.rst
+++ b/doc/mpl_toolkits/axisartist/overview.rst
@@ -15,7 +15,12 @@ to draw ticks, ticklines and etc., Axes in axisartist uses special
artist (AxisArtist) which can handle tick, ticklines and etc. for
curved coordinate systems.
-.. plot:: mpl_toolkits/axisartist/examples/demo_floating_axis.py
+.. figure:: ../../gallery/axisartist/images/sphx_glr_demo_floating_axis_001.png
+ :target: ../../gallery/axisartist/demo_floating_axis.html
+ :align: center
+ :scale: 50
+
+ Demo Floating Axis
Since it uses special artists, some mpl commands that work on
Axes.xaxis and Axes.yaxis may not work.
@@ -57,7 +62,12 @@ For example, you can hide the right, and top axis by ::
ax.axis["top"].set_visible(False)
-.. plot:: mpl_toolkits/axisartist/figures/simple_axisline3.py
+.. figure:: ../../gallery/userdemo/images/sphx_glr_simple_axisline3_001.png
+ :target: ../../gallery/userdemo/simple_axisline3.html
+ :align: center
+ :scale: 50
+
+ Simple Axisline3
It is also possible to add an extra axis. For example, you may have an
@@ -65,8 +75,12 @@ horizontal axis at y=0 (in data coordinate). ::
ax.axis["y=0"] = ax.new_floating_axis(nth_coord=0, value=0)
-.. plot:: mpl_toolkits/axisartist/figures/simple_axisartist1.py
- :include-source:
+.. figure:: ../../gallery/userdemo/images/sphx_glr_simple_axisartist1_001.png
+ :target: ../../gallery/userdemo/simple_axisartist1.html
+ :align: center
+ :scale: 50
+
+ Simple Axisartist1
Or a fixed axis with some offset ::
@@ -93,7 +107,12 @@ to create a host subplot with axisartist.Axes, ::
Here is an example that uses parasiteAxes.
-.. plot:: mpl_toolkits/axisartist/examples/demo_parasite_axes2.py
+.. figure:: ../../gallery/axisartist/images/sphx_glr_demo_parasite_axes2_001.png
+ :target: ../../gallery/axisartist/demo_parasite_axes2.html
+ :align: center
+ :scale: 50
+
+ Demo Parasite Axes2
@@ -103,7 +122,12 @@ Curvilinear Grid
The motivation behind the AxisArtist module is to support curvilinear grid
and ticks.
-.. plot:: mpl_toolkits/axisartist/examples/demo_curvelinear_grid.py
+.. figure:: ../../gallery/axisartist/images/sphx_glr_demo_curvelinear_grid_001.png
+ :target: ../../gallery/axisartist/demo_curvelinear_grid.html
+ :align: center
+ :scale: 50
+
+ Demo Curvelinear Grid
See :ref:`axisartist-manual` for more details.
@@ -114,4 +138,16 @@ Floating Axes
This also support a Floating Axes whose outer axis are defined as
floating axis.
-.. plot:: mpl_toolkits/axisartist/examples/demo_floating_axes.py
+.. figure:: ../../gallery/axisartist/images/sphx_glr_demo_floating_axes_001.png
+ :target: ../../gallery/axisartist/demo_floating_axes.html
+ :align: center
+ :scale: 50
+
+ Demo Floating Axes
+
+
+
+
+
+
+
diff --git a/doc/mpl_toolkits/axisartist/users/axisartist.rst b/doc/mpl_toolkits/axisartist/users/axisartist.rst
index 09c24055f598..958656a3177e 100644
--- a/doc/mpl_toolkits/axisartist/users/axisartist.rst
+++ b/doc/mpl_toolkits/axisartist/users/axisartist.rst
@@ -29,7 +29,12 @@ In summary, all these changes was to support
* a curvilinear grid.
* a floating axis
-.. plot:: mpl_toolkits/axisartist/examples/demo_floating_axis.py
+.. figure:: ../../../gallery/axisartist/images/sphx_glr_demo_floating_axis_001.png
+ :target: ../../../gallery/axisartist/demo_floating_axis.html
+ :align: center
+ :scale: 50
+
+ Demo Floating Axis
*mpl_toolkits.axisartist.Axes* class defines a *axis* attribute, which
@@ -195,7 +200,12 @@ using "set_axis_direction" method. ::
ax1.axis["left"].major_ticklabels.set_axis_direction("top")
ax1.axis["right"].label.set_axis_direction("left")
-.. plot:: mpl_toolkits/axisartist/figures/simple_axis_direction01.py
+.. figure:: ../../../gallery/userdemo/images/sphx_glr_simple_axis_direction01_001.png
+ :target: ../../../gallery/userdemo/simple_axis_direction01.html
+ :align: center
+ :scale: 50
+
+ Simple Axis Direction01
The parameter for set_axis_direction is one of ["left", "right",
"bottom", "top"].
@@ -206,7 +216,12 @@ You must understand some underlying concept of directions.
of the axis line with increasing coordinate. For example, the
reference direction of the left x-axis is from bottom to top.
- .. plot:: mpl_toolkits/axisartist/figures/axis_direction_demo_step01.py
+ .. figure:: ../../../gallery/userdemo/images/sphx_glr_axis_direction_demo_step01_001.png
+ :target: ../../../gallery/userdemo/axis_direction_demo_step01.html
+ :align: center
+ :scale: 50
+
+ Axis Direction Demo - Step 01
The direction, text angle, and alignments of the ticks, ticklabels and
axis-label is determined with respect to the reference direction
@@ -214,11 +229,21 @@ You must understand some underlying concept of directions.
2. *ticklabel_direction* is either the right-hand side (+) of the
reference direction or the left-hand side (-).
- .. plot:: mpl_toolkits/axisartist/figures/axis_direction_demo_step02.py
+ .. figure:: ../../../gallery/userdemo/images/sphx_glr_axis_direction_demo_step02_001.png
+ :target: ../../../gallery/userdemo/axis_direction_demo_step02.html
+ :align: center
+ :scale: 50
+
+ Axis Direction Demo - Step 02
3. same for the *label_direction*
- .. plot:: mpl_toolkits/axisartist/figures/axis_direction_demo_step03.py
+ .. figure:: ../../../gallery/userdemo/images/sphx_glr_axis_direction_demo_step03_001.png
+ :target: ../../../gallery/userdemo/axis_direction_demo_step03.html
+ :align: center
+ :scale: 50
+
+ Axis Direction Demo - Step 03
4. ticks are by default drawn toward the opposite direction of the ticklabels.
@@ -226,7 +251,12 @@ You must understand some underlying concept of directions.
to the *ticklabel_direction* or *label_direction*,
respectively. The rotation of ticklabels and label is anchored.
- .. plot:: mpl_toolkits/axisartist/figures/axis_direction_demo_step04.py
+ .. figure:: ../../../gallery/userdemo/images/sphx_glr_axis_direction_demo_step04_001.png
+ :target: ../../../gallery/userdemo/axis_direction_demo_step04.html
+ :align: center
+ :scale: 50
+
+ Axis Direction Demo - Step 04
On the other hand, there is a concept of "axis_direction". This is a
@@ -251,7 +281,12 @@ And, 'set_axis_direction("top")' means to adjust the text rotation
etc, for settings suitable for "top" axis. The concept of axis
direction can be more clear with curved axis.
-.. plot:: mpl_toolkits/axisartist/figures/demo_axis_direction.py
+.. figure:: ../../../gallery/userdemo/images/sphx_glr_demo_axis_direction_001.png
+ :target: ../../../gallery/userdemo/demo_axis_direction.html
+ :align: center
+ :scale: 50
+
+ Demo Axis Direction
The axis_direction can be adjusted in the AxisArtist level, or in the
level of its child arists, i.e., ticks, ticklabels, and axis-label. ::
@@ -281,7 +316,12 @@ default direction). ::
ax.axis[:].major_ticks.set_tick_out(True)
-.. plot:: mpl_toolkits/axisartist/figures/simple_axis_direction03.py
+.. figure:: ../../../gallery/userdemo/images/sphx_glr_simple_axis_direction03_001.png
+ :target: ../../../gallery/userdemo/simple_axis_direction03.html
+ :align: center
+ :scale: 50
+
+ Simple Axis Direction03
So, in summary,
@@ -310,7 +350,12 @@ Adjusting ticklabels alignment
Alignment of TickLabels are treated specially. See below
-.. plot:: mpl_toolkits/axisartist/figures/demo_ticklabel_alignment.py
+.. figure:: ../../../gallery/userdemo/images/sphx_glr_demo_ticklabel_alignment_001.png
+ :target: ../../../gallery/userdemo/demo_ticklabel_alignment.html
+ :align: center
+ :scale: 50
+
+ Demo Ticklabel Alignment
Adjusting pad
--------------
@@ -324,7 +369,12 @@ Or ticklabels and axis-label ::
ax.axis["left"].label.set_pad(10)
-.. plot:: mpl_toolkits/axisartist/figures/simple_axis_pad.py
+.. figure:: ../../../gallery/userdemo/images/sphx_glr_simple_axis_pad_001.png
+ :target: ../../../gallery/userdemo/simple_axis_pad.html
+ :align: center
+ :scale: 50
+
+ Simple Axis Pad
GridHelper
@@ -418,7 +468,12 @@ coordinates, or you may use Parasite Axes for convenience.::
ax1.parasites.append(ax2)
-.. plot:: mpl_toolkits/axisartist/examples/demo_curvelinear_grid.py
+.. figure:: ../../../gallery/axisartist/images/sphx_glr_demo_curvelinear_grid_001.png
+ :target: ../../../gallery/axisartist/demo_curvelinear_grid.html
+ :align: center
+ :scale: 50
+
+ Demo Curvelinear Grid
@@ -455,3 +510,10 @@ The code need more refinement. Here is a incomplete list of issues and TODO's
* The location of axislabel of FloatingAxis needs to be optionally
given as a coordinate value. ex, a floating axis of x=0 with label at y=1
+
+
+
+
+
+
+
diff --git a/doc/mpl_toolkits/index.rst b/doc/mpl_toolkits/index.rst
index 8b6538bdcc34..e36f1b030e68 100644
--- a/doc/mpl_toolkits/index.rst
+++ b/doc/mpl_toolkits/index.rst
@@ -30,7 +30,12 @@ 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:: gallery/mplot3d/contourf3d_2.py
+.. figure:: ../gallery/mplot3d/images/sphx_glr_contourf3d_2_001.png
+ :target: ../gallery/mplot3d/contourf3d_2.html
+ :align: center
+ :scale: 50
+
+ Contourf3d 2
.. _toolkit_axes_grid1:
@@ -54,3 +59,4 @@ axisartist
The :ref:`mpl_toolkits.axisartist ` toolkit contains
a custom Axes class that is meant to support for curvilinear grids.
+
diff --git a/doc/mpl_toolkits/mplot3d/tutorial.rst b/doc/mpl_toolkits/mplot3d/tutorial.rst
index afef33049adf..f3ce4baa02fb 100644
--- a/doc/mpl_toolkits/mplot3d/tutorial.rst
+++ b/doc/mpl_toolkits/mplot3d/tutorial.rst
@@ -36,7 +36,12 @@ Line plots
====================
.. automethod:: Axes3D.plot
-.. plot:: gallery/mplot3d/lines3d.py
+.. figure:: ../../gallery/mplot3d/images/sphx_glr_lines3d_001.png
+ :target: ../../gallery/mplot3d/lines3d.html
+ :align: center
+ :scale: 50
+
+ Lines3d
.. _scatter3d:
@@ -44,7 +49,12 @@ Scatter plots
=============
.. automethod:: Axes3D.scatter
-.. plot:: gallery/mplot3d/scatter3d.py
+.. figure:: ../../gallery/mplot3d/images/sphx_glr_scatter3d_001.png
+ :target: ../../gallery/mplot3d/scatter3d.html
+ :align: center
+ :scale: 50
+
+ Scatter3d
.. _wireframe:
@@ -52,7 +62,12 @@ Wireframe plots
===============
.. automethod:: Axes3D.plot_wireframe
-.. plot:: gallery/mplot3d/wire3d.py
+.. figure:: ../../gallery/mplot3d/images/sphx_glr_wire3d_001.png
+ :target: ../../gallery/mplot3d/wire3d.html
+ :align: center
+ :scale: 50
+
+ Wire3d
.. _surface:
@@ -60,9 +75,16 @@ Surface plots
=============
.. automethod:: Axes3D.plot_surface
-.. plot:: gallery/mplot3d/surface3d.py
-.. plot:: gallery/mplot3d/surface3d_2.py
-.. plot:: gallery/mplot3d/surface3d_3.py
+.. figure:: ../../gallery/mplot3d/images/sphx_glr_surface3d_001.png
+ :target: ../../gallery/mplot3d/surface3d.html
+ :align: center
+ :scale: 50
+
+ Surface3d
+
+ Surface3d 2
+
+ Surface3d 3
.. _trisurface:
@@ -70,7 +92,12 @@ Tri-Surface plots
=================
.. automethod:: Axes3D.plot_trisurf
-.. plot:: gallery/mplot3d/trisurf3d.py
+.. figure:: ../../gallery/mplot3d/images/sphx_glr_trisurf3d_001.png
+ :target: ../../gallery/mplot3d/trisurf3d.html
+ :align: center
+ :scale: 50
+
+ Trisurf3d
.. _contour3d:
@@ -79,9 +106,16 @@ Contour plots
=============
.. automethod:: Axes3D.contour
-.. plot:: gallery/mplot3d/contour3d.py
-.. plot:: gallery/mplot3d/contour3d_2.py
-.. plot:: gallery/mplot3d/contour3d_3.py
+.. figure:: ../../gallery/mplot3d/images/sphx_glr_contour3d_001.png
+ :target: ../../gallery/mplot3d/contour3d.html
+ :align: center
+ :scale: 50
+
+ Contour3d
+
+ Contour3d 2
+
+ Contour3d 3
.. _contourf3d:
@@ -89,8 +123,14 @@ Filled contour plots
====================
.. automethod:: Axes3D.contourf
-.. plot:: gallery/mplot3d/contourf3d.py
-.. plot:: gallery/mplot3d/contourf3d_2.py
+.. figure:: ../../gallery/mplot3d/images/sphx_glr_contourf3d_001.png
+ :target: ../../gallery/mplot3d/contourf3d.html
+ :align: center
+ :scale: 50
+
+ Contourf3d
+
+ Contourf3d 2
.. versionadded:: 1.1.0
The feature demoed in the second contourf3d example was enabled as a
@@ -102,7 +142,12 @@ Polygon plots
====================
.. automethod:: Axes3D.add_collection3d
-.. plot:: gallery/mplot3d/polys3d.py
+.. figure:: ../../gallery/mplot3d/images/sphx_glr_polys3d_001.png
+ :target: ../../gallery/mplot3d/polys3d.html
+ :align: center
+ :scale: 50
+
+ Polys3d
.. _bar3d:
@@ -110,7 +155,12 @@ Bar plots
====================
.. automethod:: Axes3D.bar
-.. plot:: gallery/mplot3d/bars3d.py
+.. figure:: ../../gallery/mplot3d/images/sphx_glr_bars3d_001.png
+ :target: ../../gallery/mplot3d/bars3d.html
+ :align: center
+ :scale: 50
+
+ Bars3d
.. _quiver3d:
@@ -118,13 +168,23 @@ Quiver
====================
.. automethod:: Axes3D.quiver
-.. plot:: gallery/mplot3d/quiver3d.py
+.. figure:: ../../gallery/mplot3d/images/sphx_glr_quiver3d_001.png
+ :target: ../../gallery/mplot3d/quiver3d.html
+ :align: center
+ :scale: 50
+
+ Quiver3d
.. _2dcollections3d:
2D plots in 3D
====================
-.. plot:: gallery/mplot3d/2dcollections3d.py
+.. figure:: ../../gallery/mplot3d/images/sphx_glr_2dcollections3d_001.png
+ :target: ../../gallery/mplot3d/2dcollections3d.html
+ :align: center
+ :scale: 50
+
+ 2dcollections3d
.. _text3d:
@@ -132,7 +192,12 @@ Text
====================
.. automethod:: Axes3D.text
-.. plot:: gallery/mplot3d/text3d.py
+.. figure:: ../../gallery/mplot3d/images/sphx_glr_text3d_001.png
+ :target: ../../gallery/mplot3d/text3d.html
+ :align: center
+ :scale: 50
+
+ Text3d
.. _3dsubplots:
@@ -146,5 +211,31 @@ in the same figure.
Subplotting 3D plots was added in v1.0.0. Earlier version can not
do this.
-.. plot:: gallery/mplot3d/subplot3d.py
-.. plot:: gallery/mplot3d/mixed_subplots.py
+.. figure:: ../../gallery/mplot3d/images/sphx_glr_subplot3d_001.png
+ :target: ../../gallery/mplot3d/subplot3d.html
+ :align: center
+ :scale: 50
+
+ Subplot3d
+
+ Mixed Subplots
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/doc/users/annotations.rst b/doc/users/annotations.rst
index c07481156c49..6de5098e5cfe 100644
--- a/doc/users/annotations.rst
+++ b/doc/users/annotations.rst
@@ -19,9 +19,12 @@ consider: the location being annotated represented by the argument
``xy`` and the location of the text ``xytext``. Both of these
arguments are ``(x,y)`` tuples.
-.. plot:: mpl_examples/pyplots/annotation_basic.py
- :include-source:
+.. figure:: ../gallery/pyplots/images/sphx_glr_annotation_basic_001.png
+ :target: ../gallery/pyplots/annotation_basic.html
+ :align: center
+ :scale: 50
+ Annotation Basic
In this example, both the ``xy`` (arrow tip) and ``xytext`` locations
(text location) are in data coordinates. There are a variety of other
@@ -80,8 +83,12 @@ keyword args like ``horizontalalignment``, ``verticalalignment`` and
``fontsize`` are passed from `~matplotlib.Axes.annotate` to the
``Text`` instance.
-.. plot:: mpl_examples/pyplots/annotation_polar.py
- :include-source:
+.. figure:: ../gallery/pyplots/images/sphx_glr_annotation_polar_001.png
+ :target: ../gallery/pyplots/annotation_polar.html
+ :align: center
+ :scale: 50
+
+ Annotation Polar
For more on all the wild and wonderful things you can do with
annotations, including fancy arrows, see :ref:`plotting-guide-annotation`
@@ -103,7 +110,12 @@ Annotating with Text with Box
Let's start with a simple example.
-.. plot:: users/plotting/examples/annotate_text_arrow.py
+.. figure:: ../gallery/userdemo/images/sphx_glr_annotate_text_arrow_001.png
+ :target: ../gallery/userdemo/annotate_text_arrow.html
+ :align: center
+ :scale: 50
+
+ Annotate Text Arrow
The :func:`~matplotlib.pyplot.text` function in the pyplot module (or
@@ -144,7 +156,12 @@ keyword arguments. Currently, following box styles are implemented.
Square ``square`` pad=0.3
========== ============== ==========================
-.. plot:: mpl_examples/pylab_examples/fancybox_demo2.py
+.. figure:: ../gallery/pylab_examples/images/sphx_glr_fancybox_demo2_001.png
+ :target: ../gallery/pylab_examples/fancybox_demo2.html
+ :align: center
+ :scale: 50
+
+ Fancybox Demo2
Note that the attribute arguments can be specified within the style
@@ -185,7 +202,12 @@ empty string as the first argument. ::
connectionstyle="arc3"),
)
-.. plot:: users/plotting/examples/annotate_simple01.py
+.. figure:: ../gallery/userdemo/images/sphx_glr_annotate_simple01_001.png
+ :target: ../gallery/userdemo/annotate_simple01.html
+ :align: center
+ :scale: 50
+
+ Annotate Simple01
The arrow drawing takes a few steps.
@@ -202,7 +224,12 @@ The arrow drawing takes a few steps.
``arrowstyle`` key value.
-.. plot:: users/plotting/examples/annotate_explain.py
+.. figure:: ../gallery/userdemo/images/sphx_glr_annotate_explain_001.png
+ :target: ../gallery/userdemo/annotate_explain.html
+ :align: center
+ :scale: 50
+
+ Annotate Explain
The creation of the connecting path between two points is controlled by
@@ -227,7 +254,12 @@ The behavior of each connection style is (limitedly) demonstrated in the
example below. (Warning : The behavior of the ``bar`` style is currently not
well defined, it may be changed in the future).
-.. plot:: users/plotting/examples/connectionstyle_demo.py
+.. figure:: ../gallery/userdemo/images/sphx_glr_connectionstyle_demo_001.png
+ :target: ../gallery/userdemo/connectionstyle_demo.html
+ :align: center
+ :scale: 50
+
+ Connectionstyle Demo
The connecting path (after clipping and shrinking) is then mutated to
@@ -250,7 +282,12 @@ an arrow patch, according to the given ``arrowstyle``.
``wedge`` tail_width=0.3,shrink_factor=0.5
========== =============================================
-.. plot:: mpl_examples/pylab_examples/fancyarrow_demo.py
+.. figure:: ../gallery/pylab_examples/images/sphx_glr_fancyarrow_demo_001.png
+ :target: ../gallery/pylab_examples/fancyarrow_demo.html
+ :align: center
+ :scale: 50
+
+ Fancyarrow Demo
Some arrowstyles only work with connection styles that generate a
quadratic-spline segment. They are ``fancy``, ``simple``, and ``wedge``.
@@ -260,19 +297,34 @@ style.
If the annotation string is given, the patchA is set to the bbox patch
of the text by default.
-.. plot:: users/plotting/examples/annotate_simple02.py
+.. figure:: ../gallery/userdemo/images/sphx_glr_annotate_simple02_001.png
+ :target: ../gallery/userdemo/annotate_simple02.html
+ :align: center
+ :scale: 50
+
+ Annotate Simple02
As in the text command, a box around the text can be drawn using
the ``bbox`` argument.
-.. plot:: users/plotting/examples/annotate_simple03.py
+.. figure:: ../gallery/userdemo/images/sphx_glr_annotate_simple03_001.png
+ :target: ../gallery/userdemo/annotate_simple03.html
+ :align: center
+ :scale: 50
+
+ Annotate Simple03
By default, the starting point is set to the center of the text
extent. This can be adjusted with ``relpos`` key value. The values
are normalized to the extent of the text. For example, (0,0) means
lower-left corner and (1,1) means top-right.
-.. plot:: users/plotting/examples/annotate_simple04.py
+.. figure:: ../gallery/userdemo/images/sphx_glr_annotate_simple04_001.png
+ :target: ../gallery/userdemo/annotate_simple04.html
+ :align: center
+ :scale: 50
+
+ Annotate Simple04
Placing Artist at the anchored location of the Axes
@@ -293,7 +345,12 @@ available in ``mpl_toolkits.axes_grid1.anchored_artists`` others in
ax.add_artist(at)
-.. plot:: users/plotting/examples/anchored_box01.py
+.. figure:: ../gallery/userdemo/images/sphx_glr_anchored_box01_001.png
+ :target: ../gallery/userdemo/anchored_box01.html
+ :align: center
+ :scale: 50
+
+ Anchored Box01
The *loc* keyword has same meaning as in the legend command.
@@ -322,7 +379,12 @@ transform set (it will be overridden) and the dimensions of those
artists are interpreted as a pixel coordinate, i.e., the radius of the
circles in above example are 10 pixels and 5 pixels, respectively.
-.. plot:: users/plotting/examples/anchored_box02.py
+.. figure:: ../gallery/userdemo/images/sphx_glr_anchored_box02_001.png
+ :target: ../gallery/userdemo/anchored_box02.html
+ :align: center
+ :scale: 50
+
+ Anchored Box02
Sometimes, you want your artists to scale with the data coordinate (or
coordinates other than canvas pixels). You can use
@@ -340,13 +402,23 @@ The ellipse in the above example will have width and height
corresponding to 0.1 and 0.4 in data coordinateing and will be
automatically scaled when the view limits of the axes change.
-.. plot:: users/plotting/examples/anchored_box03.py
+.. figure:: ../gallery/userdemo/images/sphx_glr_anchored_box03_001.png
+ :target: ../gallery/userdemo/anchored_box03.html
+ :align: center
+ :scale: 50
+
+ Anchored Box03
As in the legend, the bbox_to_anchor argument can be set. Using the
HPacker and VPacker, you can have an arrangement(?) of artist as in the
legend (as a matter of fact, this is how the legend is created).
-.. plot:: users/plotting/examples/anchored_box04.py
+.. figure:: ../gallery/userdemo/images/sphx_glr_anchored_box04_001.png
+ :target: ../gallery/userdemo/anchored_box04.html
+ :align: center
+ :scale: 50
+
+ Anchored Box04
Note that unlike the legend, the ``bbox_transform`` is set
to IdentityTransform by default.
@@ -386,7 +458,12 @@ more control, it supports a few other options.
bbox=dict(boxstyle="round", fc="w"),
arrowprops=dict(arrowstyle="->"))
- .. plot:: users/plotting/examples/annotate_simple_coord01.py
+ .. figure:: ../gallery/userdemo/images/sphx_glr_annotate_simple_coord01_001.png
+ :target: ../gallery/userdemo/annotate_simple_coord01.html
+ :align: center
+ :scale: 50
+
+ Annotation with Simple Coordinates
Note that it is your responsibility that the extent of the
coordinate artist (*an1* in above example) is determined before *an2*
@@ -416,16 +493,23 @@ more control, it supports a few other options.
0.5 is in data coordinates, and 1 is in normalized axes coordinates.
You may use an artist or transform as with a tuple. For example,
- .. plot:: users/plotting/examples/annotate_simple_coord02.py
- :include-source:
+ .. figure:: ../gallery/userdemo/images/sphx_glr_annotate_simple_coord02_001.png
+ :target: ../gallery/userdemo/annotate_simple_coord02.html
+ :align: center
+ :scale: 50
+ Annotation with Simple Coordinates 2
5. Sometimes, you want your annotation with some "offset points", not from the
annotated point but from some other point.
:class:`~matplotlib.text.OffsetFrom` is a helper class for such cases.
- .. plot:: users/plotting/examples/annotate_simple_coord03.py
- :include-source:
+ .. figure:: ../gallery/userdemo/images/sphx_glr_annotate_simple_coord03_001.png
+ :target: ../gallery/userdemo/annotate_simple_coord03.html
+ :align: center
+ :scale: 50
+
+ Annotation with Simple Coordinates 3
You may take a look at this example :ref:`pylab_examples-annotation_demo3`.
@@ -445,7 +529,12 @@ you want to connect points in different axes. ::
The above code connects point xy in the data coordinates of ``ax1`` to
point xy in the data coordinates of ``ax2``. Here is a simple example.
-.. plot:: users/plotting/examples/connect_simple01.py
+.. figure:: ../gallery/userdemo/images/sphx_glr_connect_simple01_001.png
+ :target: ../gallery/userdemo/connect_simple01.html
+ :align: center
+ :scale: 50
+
+ Connect Simple01
While the ConnectorPatch instance can be added to any axes, you may want to add
@@ -465,7 +554,12 @@ knowledge of how mpl's transform works. But, utilizing it will be
straight forward.
-.. plot:: mpl_examples/pylab_examples/axes_zoom_effect.py
+.. figure:: ../gallery/pylab_examples/images/sphx_glr_axes_zoom_effect_001.png
+ :target: ../gallery/pylab_examples/axes_zoom_effect.html
+ :align: center
+ :scale: 50
+
+ Axes Zoom Effect
Define Custom BoxStyle
@@ -489,15 +583,42 @@ callable object in the following forms.::
Here is a complete example.
-.. plot:: users/plotting/examples/custom_boxstyle01.py
+.. figure:: ../gallery/userdemo/images/sphx_glr_custom_boxstyle01_001.png
+ :target: ../gallery/userdemo/custom_boxstyle01.html
+ :align: center
+ :scale: 50
+
+ Custom Boxstyle01
However, it is recommended that you derive from the
matplotlib.patches.BoxStyle._Base as demonstrated below.
-.. plot:: users/plotting/examples/custom_boxstyle02.py
- :include-source:
+.. figure:: ../gallery/userdemo/images/sphx_glr_custom_boxstyle02_001.png
+ :target: ../gallery/userdemo/custom_boxstyle02.html
+ :align: center
+ :scale: 50
+
+ Custom Boxstyle02
Similarly, you can define a custom ConnectionStyle and a custom ArrowStyle.
See the source code of ``lib/matplotlib/patches.py`` and check
how each style class is defined.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/doc/users/artists.rst b/doc/users/artists.rst
index b6f600b572cf..c051374781f8 100644
--- a/doc/users/artists.rst
+++ b/doc/users/artists.rst
@@ -133,7 +133,12 @@ drawing of the ticks, tick labels and axis labels.
Try creating the figure below.
-.. plot:: mpl_examples/pyplots/fig_axes_labels_simple.py
+.. figure:: ../gallery/pyplots/images/sphx_glr_fig_axes_labels_simple_001.png
+ :target: ../gallery/pyplots/fig_axes_labels_simple.html
+ :align: center
+ :scale: 50
+
+ Fig Axes Labels Simple
.. _customizing-artists:
@@ -323,7 +328,12 @@ obtain by setting the ``Artist`` transform to :attr:`fig.transFigure
In [195]: fig.canvas.draw()
-.. plot:: mpl_examples/pyplots/fig_x.py
+.. figure:: ../gallery/pyplots/images/sphx_glr_fig_x_001.png
+ :target: ../gallery/pyplots/fig_x.html
+ :align: center
+ :scale: 50
+
+ Fig X
Here is a summary of the Artists the figure contains
@@ -598,8 +608,12 @@ grid Turn the grid on or off for the major or minor ticks
Here is an example, not recommended for its beauty, which customizes
the axes and tick properties
-.. plot:: mpl_examples/pyplots/fig_axes_customize_simple.py
- :include-source:
+.. figure:: ../gallery/pyplots/images/sphx_glr_fig_axes_customize_simple_001.png
+ :target: ../gallery/pyplots/fig_axes_customize_simple.html
+ :align: center
+ :scale: 50
+
+ Fig Axes Customize Simple
.. _tick-container:
@@ -635,5 +649,14 @@ label2On boolean which determines whether to draw the 2nd tick label
Here is an example which sets the formatter for the right side ticks with
dollar signs and colors them green on the right side of the yaxis
-.. plot:: mpl_examples/pyplots/dollar_ticks.py
- :include-source:
+.. figure:: ../gallery/pyplots/images/sphx_glr_dollar_ticks_001.png
+ :target: ../gallery/pyplots/dollar_ticks.html
+ :align: center
+ :scale: 50
+
+ Dollar Ticks
+
+
+
+
+
diff --git a/doc/users/colormapnorms.rst b/doc/users/colormapnorms.rst
index e7ea14251340..2e75ea387fbf 100644
--- a/doc/users/colormapnorms.rst
+++ b/doc/users/colormapnorms.rst
@@ -44,8 +44,12 @@ there are two bumps, one much smaller than the other. Using
:func:`colors.LogNorm`, the shape and location of each bump can clearly
be seen:
-.. plot:: users/plotting/examples/colormap_normalizations_lognorm.py
- :include-source:
+.. figure:: ../gallery/userdemo/images/sphx_glr_colormap_normalizations_lognorm_001.png
+ :target: ../gallery/userdemo/colormap_normalizations_lognorm.html
+ :align: center
+ :scale: 50
+
+ Colormap Normalizations Lognorm
Symmetric logarithmic
---------------------
@@ -65,8 +69,12 @@ set by *linscale*. When *linscale* == 1.0 (the default), the space used
for the positive and negative halves of the linear range will be equal
to one decade in the logarithmic range.
-.. plot:: users/plotting/examples/colormap_normalizations_symlognorm.py
- :include-source:
+.. figure:: ../gallery/userdemo/images/sphx_glr_colormap_normalizations_symlognorm_001.png
+ :target: ../gallery/userdemo/colormap_normalizations_symlognorm.html
+ :align: center
+ :scale: 50
+
+ Colormap Normalizations Symlognorm
Power-law
---------
@@ -86,8 +94,12 @@ normalization):
been used.
-.. plot:: users/plotting/examples/colormap_normalizations_power.py
- :include-source:
+.. figure:: ../gallery/userdemo/images/sphx_glr_colormap_normalizations_power_001.png
+ :target: ../gallery/userdemo/colormap_normalizations_power.html
+ :align: center
+ :scale: 50
+
+ Colormap Normalizations Power
Discrete bounds
---------------
@@ -111,8 +123,12 @@ instance:
Note unlike the other norms, this norm returns values from 0 to *ncolors*-1.
-.. plot:: users/plotting/examples/colormap_normalizations_bounds.py
- :include-source:
+.. figure:: ../gallery/userdemo/images/sphx_glr_colormap_normalizations_bounds_001.png
+ :target: ../gallery/userdemo/colormap_normalizations_bounds.html
+ :align: center
+ :scale: 50
+
+ Colormap Normalizations Bounds
Custom normalization: Two linear ranges
@@ -132,5 +148,15 @@ cases such as masked data)
practical example is having an ocean/land colormap where the land and
ocean data span different ranges.
-.. plot:: users/plotting/examples/colormap_normalizations_custom.py
- :include-source:
+.. figure:: ../gallery/userdemo/images/sphx_glr_colormap_normalizations_custom_001.png
+ :target: ../gallery/userdemo/colormap_normalizations_custom.html
+ :align: center
+ :scale: 50
+
+ Colormap Normalizations Custom
+
+
+
+
+
+
diff --git a/doc/users/colormaps.rst b/doc/users/colormaps.rst
index bb59c7e90dc1..6365f3acfbc2 100644
--- a/doc/users/colormaps.rst
+++ b/doc/users/colormaps.rst
@@ -125,7 +125,12 @@ that the :math:`L^*` values vary widely throughout the colormap, making it a
poor choice for representing data for viewers to see perceptually. See an
extension on this idea at [mycarta-jet]_.
-.. plot:: users/plotting/colormaps/lightness.py
+.. figure:: ../gallery/color/images/sphx_glr_lightness_001.png
+ :target: ../gallery/color/lightness.html
+ :align: center
+ :scale: 50
+
+ Lightness
Grayscale conversion
====================
@@ -161,7 +166,12 @@ lighter and back to darker gray throughout the colormap. This would make it
impossible for a viewer to interpret the information in a plot once it is
printed in grayscale.
-.. plot:: users/plotting/colormaps/grayscale.py
+.. figure:: ../gallery/color/images/sphx_glr_grayscale_001.png
+ :target: ../gallery/color/grayscale.html
+ :align: center
+ :scale: 50
+
+ Grayscale
Color vision deficiencies
@@ -192,3 +202,5 @@ References
.. [colorblindness] http://www.color-blindness.com/
.. [vischeck] http://www.vischeck.com/vischeck/
.. [IBM] http://www.research.ibm.com/people/l/lloydt/color/color.HTM
+
+
diff --git a/doc/users/gridspec.rst b/doc/users/gridspec.rst
index f62d723ac21e..2fc48913c692 100644
--- a/doc/users/gridspec.rst
+++ b/doc/users/gridspec.rst
@@ -49,7 +49,12 @@ For example, the following commands ::
creates
-.. plot:: users/plotting/examples/demo_gridspec01.py
+.. figure:: ../gallery/userdemo/images/sphx_glr_demo_gridspec01_000.png
+ :target: ../gallery/userdemo/demo_gridspec01.html
+ :align: center
+ :scale: 50
+
+ Demo Gridspec01
GridSpec and SubplotSpec
@@ -84,7 +89,12 @@ The above example becomes ::
ax4 = plt.subplot(gs[-1, 0])
ax5 = plt.subplot(gs[-1, -2])
-.. plot:: users/plotting/examples/demo_gridspec02.py
+.. figure:: ../gallery/userdemo/images/sphx_glr_demo_gridspec02_001.png
+ :target: ../gallery/userdemo/demo_gridspec02.html
+ :align: center
+ :scale: 50
+
+ Demo Gridspec02
Adjust GridSpec layout
======================
@@ -114,7 +124,12 @@ The code below ::
creates
-.. plot:: users/plotting/examples/demo_gridspec03.py
+.. figure:: ../gallery/userdemo/images/sphx_glr_demo_gridspec03_001.png
+ :target: ../gallery/userdemo/demo_gridspec03.html
+ :align: center
+ :scale: 50
+
+ Demo Gridspec03
GridSpec using SubplotSpec
==========================
@@ -129,7 +144,12 @@ the given SubplotSpec. ::
gs01 = gridspec.GridSpecFromSubplotSpec(3, 3, subplot_spec=gs0[1])
-.. plot:: users/plotting/examples/demo_gridspec04.py
+.. figure:: ../gallery/userdemo/images/sphx_glr_demo_gridspec04_001.png
+ :target: ../gallery/userdemo/demo_gridspec04.html
+ :align: center
+ :scale: 50
+
+ Demo Gridspec04
A Complex Nested GridSpec using SubplotSpec
@@ -139,7 +159,12 @@ Here's a more sophisticated example of nested GridSpec where we put
a box around each cell of the outer 4x4 grid, by hiding appropriate
spines in each of the inner 3x3 grids.
-.. plot:: users/plotting/examples/demo_gridspec06.py
+.. figure:: ../gallery/userdemo/images/sphx_glr_demo_gridspec06_001.png
+ :target: ../gallery/userdemo/demo_gridspec06.html
+ :align: center
+ :scale: 50
+
+ Demo Gridspec06
GridSpec with Varying Cell Sizes
@@ -160,5 +185,16 @@ values are meaningless, only their relative ratios matter. ::
ax4 = plt.subplot(gs[3])
-.. plot:: users/plotting/examples/demo_gridspec05.py
+.. figure:: ../gallery/userdemo/images/sphx_glr_demo_gridspec05_001.png
+ :target: ../gallery/userdemo/demo_gridspec05.html
+ :align: center
+ :scale: 50
+
+ Demo Gridspec05
+
+
+
+
+
+
diff --git a/doc/users/image_tutorial.rst b/doc/users/image_tutorial.rst
index 1d1f58ee5e82..a79fcf2e5ed9 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>`_.
+<../gallery/color/colormaps_reference.html>`_.
.. _`Color Bars`:
diff --git a/doc/users/legend_guide.rst b/doc/users/legend_guide.rst
index 1ee6448059ce..8f179f34f8d2 100644
--- a/doc/users/legend_guide.rst
+++ b/doc/users/legend_guide.rst
@@ -116,8 +116,12 @@ the corner's location, and the coordinate system of that location::
More examples of custom legend placement:
-.. plot:: users/plotting/examples/simple_legend01.py
- :include-source:
+.. figure:: ../gallery/userdemo/images/sphx_glr_simple_legend01_001.png
+ :target: ../gallery/userdemo/simple_legend01.html
+ :align: center
+ :scale: 50
+
+ Simple Legend01
Multiple legends on the same Axes
@@ -131,8 +135,12 @@ to call :func:`legend` repeatedly to update the legend to the latest
handles on the Axes, so to persist old legend instances, we must add them
manually to the Axes:
-.. plot:: users/plotting/examples/simple_legend02.py
- :include-source:
+.. figure:: ../gallery/userdemo/images/sphx_glr_simple_legend02_001.png
+ :target: ../gallery/userdemo/simple_legend02.html
+ :align: center
+ :scale: 50
+
+ Simple Legend02
Legend Handlers
===============
@@ -294,3 +302,5 @@ being used in various ways:
* :ref:`pylab_examples-contourf_hatching`
* :ref:`pylab_examples-figlegend_demo`
* :ref:`pylab_examples-scatter_symbol`
+
+
diff --git a/doc/users/mathtext.rst b/doc/users/mathtext.rst
index a0e1b8ddd6a4..6904f9b2a5f3 100644
--- a/doc/users/mathtext.rst
+++ b/doc/users/mathtext.rst
@@ -340,5 +340,11 @@ Example
Here is an example illustrating many of these features in context.
-.. plot:: mpl_examples/pyplots/pyplot_mathtext.py
- :include-source:
+.. figure:: ../gallery/pyplots/images/sphx_glr_pyplot_mathtext_001.png
+ :target: ../gallery/pyplots/pyplot_mathtext.html
+ :align: center
+ :scale: 50
+
+ Pyplot Mathtext
+
+
diff --git a/doc/users/path_tutorial.rst b/doc/users/path_tutorial.rst
index 47a3891c6267..f820a1eeb4dc 100644
--- a/doc/users/path_tutorial.rst
+++ b/doc/users/path_tutorial.rst
@@ -184,4 +184,11 @@ All that remains is to create the path, attach it to a
Here is the result
-.. plot:: mpl_examples/pyplots/compound_path_demo.py
+.. figure:: ../gallery/pyplots/images/sphx_glr_compound_path_demo_001.png
+ :target: ../gallery/pyplots/compound_path_demo.html
+ :align: center
+ :scale: 50
+
+ Compound Path Demo
+
+
diff --git a/doc/users/pgf.rst b/doc/users/pgf.rst
index 041ff8cf5553..7b3ce8771b5c 100644
--- a/doc/users/pgf.rst
+++ b/doc/users/pgf.rst
@@ -70,11 +70,9 @@ fonts *CMU Serif*, *CMU Sans Serif*, etc.
When saving to ``.pgf``, the font configuration matplotlib used for the
layout of the figure is included in the header of the text file.
-.. literalinclude:: plotting/examples/pgf_fonts.py
+.. literalinclude:: ../gallery/userdemo/pgf_fonts_sgskip.py
:end-before: plt.savefig
-.. image:: /_static/pgf_fonts.*
-
.. _pgf-preamble:
@@ -89,16 +87,14 @@ specified in the rc parameters, make sure to disable ``pgf.rcfonts``.
.. htmlonly::
- .. literalinclude:: plotting/examples/pgf_preamble.py
+ .. literalinclude:: ../gallery/userdemo/pgf_preamble_sgskip.py
:end-before: plt.savefig
.. latexonly::
- .. literalinclude:: plotting/examples/pgf_preamble.py
+ .. literalinclude:: ../gallery/userdemo/pgf_preamble_sgskip.py
:end-before: import matplotlib.pyplot as plt
-.. image:: /_static/pgf_preamble.*
-
.. _pgf-texsystem:
@@ -110,11 +106,9 @@ parameter. Possible values are ``'xelatex'`` (default), ``'lualatex'`` and
``'pdflatex'``. Please note that when selecting pdflatex the fonts and
unicode handling must be configured in the preamble.
-.. literalinclude:: plotting/examples/pgf_texsystem.py
+.. literalinclude:: ../gallery/userdemo/pgf_texsystem_sgskip.py
:end-before: plt.savefig
-.. image:: /_static/pgf_texsystem.*
-
.. _pgf-troubleshooting:
diff --git a/doc/users/prev_whats_new/whats_new_0.98.4.rst b/doc/users/prev_whats_new/whats_new_0.98.4.rst
index 42a4eb486d2d..07665d9a8a5f 100644
--- a/doc/users/prev_whats_new/whats_new_0.98.4.rst
+++ b/doc/users/prev_whats_new/whats_new_0.98.4.rst
@@ -30,7 +30,12 @@ multiple columns and rows, as well as fancy box drawing. See
:func:`~matplotlib.pyplot.legend` and
:class:`matplotlib.legend.Legend`.
-.. plot:: mpl_examples/pyplots/whats_new_98_4_legend.py
+.. figure:: ../../gallery/pyplots/images/sphx_glr_whats_new_98_4_legend_001.png
+ :target: ../../gallery/pyplots/whats_new_98_4_legend.html
+ :align: center
+ :scale: 50
+
+ Whats New 98 4 Legend
.. _fancy-annotations:
@@ -44,7 +49,12 @@ boxes and connectors in annotations. See
:class:`~matplotlib.patches.ArrowStyle`, and
:class:`~matplotlib.patches.ConnectionStyle`.
-.. plot:: mpl_examples/pyplots/whats_new_98_4_fancy.py
+.. figure:: ../../gallery/pyplots/images/sphx_glr_whats_new_98_4_fancy_001.png
+ :target: ../../gallery/pyplots/whats_new_98_4_fancy.html
+ :align: center
+ :scale: 50
+
+ Whats New 98 4 Fancy
.. _psd-amplitude:
@@ -84,7 +94,12 @@ can pass an *x* array and a *ylower* and *yupper* array to fill
between, and an optional *where* argument which is a logical mask
where you want to do the filling.
-.. plot:: mpl_examples/pyplots/whats_new_98_4_fill_between.py
+.. figure:: ../../gallery/pyplots/images/sphx_glr_whats_new_98_4_fill_between_001.png
+ :target: ../../gallery/pyplots/whats_new_98_4_fill_between.html
+ :align: center
+ :scale: 50
+
+ Whats New 98 4 Fill Between
Lots more
-----------
@@ -283,3 +298,6 @@ Here are the 0.98.4 notes from the CHANGELOG::
Added support for arbitrary rasterization resolutions to the SVG
backend. - MW
+
+
+
diff --git a/doc/users/prev_whats_new/whats_new_0.99.rst b/doc/users/prev_whats_new/whats_new_0.99.rst
index 34c2e076cea8..bc8d0e8cea9f 100644
--- a/doc/users/prev_whats_new/whats_new_0.99.rst
+++ b/doc/users/prev_whats_new/whats_new_0.99.rst
@@ -29,7 +29,12 @@ toolkit mpl_toolkits.mplot3d (which now comes standard with all mpl
installs). See :ref:`mplot3d-examples-index` and
:ref:`toolkit_mplot3d-tutorial`
-.. plot:: mpl_examples/pyplots/whats_new_99_mplot3d.py
+.. figure:: ../../gallery/pyplots/images/sphx_glr_whats_new_99_mplot3d_001.png
+ :target: ../../gallery/pyplots/whats_new_99_mplot3d.html
+ :align: center
+ :scale: 50
+
+ Whats New 99 Mplot3d
.. _whats-new-axes-grid:
@@ -43,7 +48,12 @@ new mpl installs. See :ref:`axes_grid1-examples-index`,
:ref:`axisartist-examples-index`, :ref:`axes_grid1_users-guide-index` and
:ref:`axisartist_users-guide-index`
-.. plot:: mpl_examples/pyplots/whats_new_99_axes_grid.py
+.. figure:: ../../gallery/pyplots/images/sphx_glr_whats_new_99_axes_grid_001.png
+ :target: ../../gallery/pyplots/whats_new_99_axes_grid.html
+ :align: center
+ :scale: 50
+
+ Whats New 99 Axes Grid
.. _whats-new-spine:
@@ -58,4 +68,13 @@ well as "detach" the spine to offset it away from the data. See
:ref:`pylab_examples-spine_placement_demo` and
:class:`matplotlib.spines.Spine`.
-.. plot:: mpl_examples/pyplots/whats_new_99_spines.py
+.. figure:: ../../gallery/pyplots/images/sphx_glr_whats_new_99_spines_001.png
+ :target: ../../gallery/pyplots/whats_new_99_spines.html
+ :align: center
+ :scale: 50
+
+ Whats New 99 Spines
+
+
+
+
diff --git a/doc/users/prev_whats_new/whats_new_1.0.rst b/doc/users/prev_whats_new/whats_new_1.0.rst
index 3e84cdc77d98..dea95bde344f 100644
--- a/doc/users/prev_whats_new/whats_new_1.0.rst
+++ b/doc/users/prev_whats_new/whats_new_1.0.rst
@@ -25,7 +25,12 @@ Jae-Joon Lee has written :mod:`~matplotlib.gridspec`, a new module for
doing complex subplot layouts, featuring row and column spans and
more. See :ref:`gridspec-guide` for a tutorial overview.
-.. plot:: users/plotting/examples/demo_gridspec01.py
+.. figure:: ../../gallery/userdemo/images/sphx_glr_demo_gridspec01_000.png
+ :target: ../../gallery/userdemo/demo_gridspec01.html
+ :align: center
+ :scale: 50
+
+ Demo Gridspec01
Easy pythonic subplots
-----------------------
@@ -53,7 +58,12 @@ Additionally, he has contributed a new module :mod:`~matplotlib.tri` and
helper function :func:`~matplotlib.pyplot.triplot` for creating and
plotting unstructured triangular grids.
-.. plot:: mpl_examples/pylab_examples/triplot_demo.py
+.. figure:: ../../gallery/pylab_examples/images/sphx_glr_triplot_demo_001.png
+ :target: ../../gallery/pylab_examples/triplot_demo.html
+ :align: center
+ :scale: 50
+
+ Triplot Demo
multiple calls to show supported
---------------------------------
@@ -82,7 +92,12 @@ supporting mixing of 2D and 3D graphs in the same figure, and/or
multiple 3D graphs in a single figure, using the "projection" keyword
argument to add_axes or add_subplot. Thanks Ben Root.
-.. plot:: mpl_examples/pyplots/whats_new_1_subplot3d.py
+.. figure:: ../../gallery/pyplots/images/sphx_glr_whats_new_1_subplot3d_001.png
+ :target: ../../gallery/pyplots/whats_new_1_subplot3d.html
+ :align: center
+ :scale: 50
+
+ Whats New 1 Subplot3d
tick_params
------------
@@ -132,3 +147,6 @@ Eric Firing went on a bug fixing and closing marathon, closing over
`__ with
help from Jae-Joon Lee, Michael Droettboom, Christoph Gohlke and
Michiel de Hoon.
+
+
+
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 bd704b305310..bb8670efb073 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,12 @@ Kevin Davies has extended Yannick Copin's original Sankey example into a module
(:ref:`api-sankey_basics`, :ref:`api-sankey_links`,
:ref:`api-sankey_rankine`).
-.. plot:: gallery/api/sankey_rankine.py
+.. figure:: ../../gallery/api/images/sphx_glr_sankey_rankine_001.png
+ :target: ../../gallery/api/sankey_rankine.html
+ :align: center
+ :scale: 50
+
+ Sankey Rankine
Animation
@@ -114,7 +119,12 @@ been improved in the presence of NANs.
See the :ref:`plotting-guide-legend` for more detailed explanation and
examples.
-.. plot:: mpl_examples/pylab_examples/legend_demo4.py
+.. figure:: ../../gallery/pylab_examples/images/sphx_glr_legend_demo4_001.png
+ :target: ../../gallery/pylab_examples/legend_demo4.html
+ :align: center
+ :scale: 50
+
+ Legend Demo4
mplot3d
-------
@@ -135,12 +145,22 @@ as 2D plotting, Ben Root has made several improvements to the
* Ticker offset display added:
-.. plot:: gallery/mplot3d/offset.py
+.. figure:: ../../gallery/mplot3d/images/sphx_glr_offset_001.png
+ :target: ../../gallery/mplot3d/offset.html
+ :align: center
+ :scale: 50
+
+ Offset
* :meth:`~mpl_toolkits.mplot3d.axes3d.Axes3D.contourf`
gains *zdir* and *offset* kwargs. You can now do this:
-.. plot:: gallery/mplot3d/contourf3d_2.py
+.. figure:: ../../gallery/mplot3d/images/sphx_glr_contourf3d_2_001.png
+ :target: ../../gallery/mplot3d/contourf3d_2.html
+ :align: center
+ :scale: 50
+
+ Contourf3d 2
Numerix support removed
-----------------------
@@ -208,3 +228,7 @@ Other improvements
other colormaps :ref:`here `.
* Many bug fixes and documentation improvements.
+
+
+
+
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 ca46ae10f508..568759cf4d1b 100644
--- a/doc/users/prev_whats_new/whats_new_1.2.rst
+++ b/doc/users/prev_whats_new/whats_new_1.2.rst
@@ -62,7 +62,12 @@ Damon McDougall added a new plotting method for the
:mod:`~mpl_toolkits.mplot3d` toolkit called
:meth:`~mpl_toolkits.mplot3d.axes3d.Axes3D.plot_trisurf`.
-.. plot:: gallery/mplot3d/trisurf3d.py
+.. figure:: ../../gallery/mplot3d/images/sphx_glr_trisurf3d_001.png
+ :target: ../../gallery/mplot3d/trisurf3d.html
+ :align: center
+ :scale: 50
+
+ Trisurf3d
Control the lengths of colorbar extensions
------------------------------------------
@@ -123,7 +128,12 @@ confidence intervals into the :meth:`~matplotlib.axes.boxplot` method. For
every column of data passed to boxplot, the user can specify an accompanying
median and confidence interval.
-.. plot:: mpl_examples/pylab_examples/boxplot_demo3.py
+.. figure:: ../../gallery/pylab_examples/images/sphx_glr_boxplot_demo3_001.png
+ :target: ../../gallery/pylab_examples/boxplot_demo3.html
+ :align: center
+ :scale: 50
+
+ Boxplot Demo3
New RC parameter functionality
@@ -153,7 +163,12 @@ 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.py
+.. figure:: ../../gallery/images_contours_and_fields/images/sphx_glr_plot_streamplot_001.png
+ :target: ../../gallery/images_contours_and_fields/plot_streamplot.html
+ :align: center
+ :scale: 50
+
+ Plot Streamplot
New hist functionality
@@ -185,7 +200,12 @@ Ian Thomas extended :meth:`~matplotlib.pyplot.tripcolor` to allow one color
value to be specified for each triangular face rather than for each point in
a triangulation.
-.. plot:: mpl_examples/pylab_examples/tripcolor_demo.py
+.. figure:: ../../gallery/pylab_examples/images/sphx_glr_tripcolor_demo_001.png
+ :target: ../../gallery/pylab_examples/tripcolor_demo.html
+ :align: center
+ :scale: 50
+
+ Tripcolor Demo
Hatching patterns in filled contour plots, with legends
-------------------------------------------------------
@@ -194,7 +214,12 @@ Phil Elson added support for hatching to
:func:`~matplotlib.pyplot.contourf`, together with the ability
to use a legend to identify contoured ranges.
-.. plot:: mpl_examples/pylab_examples/contourf_hatching.py
+.. figure:: ../../gallery/pylab_examples/images/sphx_glr_contourf_hatching_001.png
+ :target: ../../gallery/pylab_examples/contourf_hatching.html
+ :align: center
+ :scale: 50
+
+ Contourf Hatching
Known issues in the matplotlib 1.2 release
------------------------------------------
@@ -202,3 +227,8 @@ Known issues in the matplotlib 1.2 release
- When using the Qt4Agg backend with IPython 0.11 or later, the save
dialog will not display. This should be fixed in a future version
of IPython.
+
+
+
+
+
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 3878f51d677c..d17a2ce8ed81 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,12 @@ 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:: gallery/showcase/xkcd.py
+.. figure:: ../../gallery/showcase/images/sphx_glr_xkcd_001.png
+ :target: ../../gallery/showcase/xkcd.html
+ :align: center
+ :scale: 50
+
+ Xkcd
Updated Axes3D.contour methods
------------------------------
@@ -100,14 +105,24 @@ Damon McDougall updated the
:meth:`~mpl_toolkits.mplot3d.axes3d.Axes3D.tricontourf` methods to allow 3D
contour plots on abitrary unstructured user-specified triangulations.
-.. plot:: gallery/mplot3d/tricontour3d.py
+.. figure:: ../../gallery/mplot3d/images/sphx_glr_tricontour3d_001.png
+ :target: ../../gallery/mplot3d/tricontour3d.html
+ :align: center
+ :scale: 50
+
+ Tricontour3d
New eventplot plot type
```````````````````````
Todd Jennings added a :func:`~matplotlib.pyplot.eventplot` function to
create multiple rows or columns of identical line segments
-.. plot:: mpl_examples/pylab_examples/eventplot_demo.py
+.. figure:: ../../gallery/pylab_examples/images/sphx_glr_eventplot_demo_001.png
+ :target: ../../gallery/pylab_examples/eventplot_demo.html
+ :align: center
+ :scale: 50
+
+ Eventplot Demo
As part of this feature, there is a new
:class:`~matplotlib.collections.EventCollection` class that allows for
@@ -126,7 +141,12 @@ perform mesh refinement and smooth contouring was also added
implementing some basic tools for triangular mesh improvement was
added (:class:`~matplotlib.tri.TriAnalyzer`).
-.. plot:: mpl_examples/pylab_examples/tricontour_smooth_user.py
+.. figure:: ../../gallery/pylab_examples/images/sphx_glr_tricontour_smooth_user_001.png
+ :target: ../../gallery/pylab_examples/tricontour_smooth_user.html
+ :align: center
+ :scale: 50
+
+ Tricontour Smooth User
Baselines for stackplot
```````````````````````
@@ -134,7 +154,12 @@ Till Stensitzki added non-zero baselines to
:func:`~matplotlib.pyplot.stackplot`. They may be symmetric or
weighted.
-.. plot:: mpl_examples/pylab_examples/stackplot_demo2.py
+.. figure:: ../../gallery/pylab_examples/images/sphx_glr_stackplot_demo2_001.png
+ :target: ../../gallery/pylab_examples/stackplot_demo2.html
+ :align: center
+ :scale: 50
+
+ Stackplot Demo2
Rectangular colorbar extensions
```````````````````````````````
@@ -174,7 +199,12 @@ Path effects on lines
`````````````````````
Thanks to Jae-Joon Lee, path effects now also work on plot lines.
-.. plot:: mpl_examples/pylab_examples/patheffect_demo.py
+.. figure:: ../../gallery/pylab_examples/images/sphx_glr_patheffect_demo_001.png
+ :target: ../../gallery/pylab_examples/patheffect_demo.html
+ :align: center
+ :scale: 50
+
+ Patheffect Demo
Easier creation of colormap and normalizer for levels with colors
`````````````````````````````````````````````````````````````````
@@ -370,3 +400,9 @@ matplotlib will now display a `RuntimeWarning` when too many figures
have been opened at once. By default, this is displayed for 20 or
more figures, but the exact number may be controlled using the
``figure.max_open_warning`` rcParam.
+
+
+
+
+
+
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 2c1d66b36d85..ab12024467e3 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,12 @@ 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:: gallery/api/skewt.py
+.. figure:: ../../gallery/api/images/sphx_glr_skewt_001.png
+ :target: ../../gallery/api/skewt.html
+ :align: center
+ :scale: 50
+
+ Skewt
Support for specifying properties of wedge and text in pie charts.
``````````````````````````````````````````````````````````````````
@@ -243,7 +248,12 @@ 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:: gallery/mplot3d/quiver3d.py
+.. figure:: ../../gallery/mplot3d/images/sphx_glr_quiver3d_001.png
+ :target: ../../gallery/mplot3d/quiver3d.html
+ :align: center
+ :scale: 50
+
+ Quiver3d
polar-plot r-tick locations
```````````````````````````
@@ -417,3 +427,5 @@ rectangle stay on the axes after you release the mouse.
GAE integration
---------------
Matplotlib will now run on google app engine.
+
+
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 11ccc4cc7365..f172a78d3841 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,12 @@ 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:: gallery/color/color_cycle.py
+.. figure:: ../../gallery/color/images/sphx_glr_color_cycle_001.png
+ :target: ../../gallery/color/color_cycle.html
+ :align: center
+ :scale: 50
+
+ Color Cycle
New Colormaps
@@ -309,7 +314,12 @@ quads touching the point; any triangular corners comprising three unmasked
points are contoured as usual. If the ``corner_mask`` keyword argument is not
specified, the default value is taken from rcParams.
-.. plot:: mpl_examples/pylab_examples/contour_corner_mask.py
+.. figure:: ../../gallery/pylab_examples/images/sphx_glr_contour_corner_mask_001.png
+ :target: ../../gallery/pylab_examples/contour_corner_mask.html
+ :align: center
+ :scale: 50
+
+ Contour Corner Mask
Mostly unified linestyles for `Line2D`, `Patch` and `Collection`
@@ -367,7 +377,12 @@ kwargs names is not ideal, but `Axes.fill_between` already has a
This is particularly useful for plotting pre-binned histograms.
-.. plot:: gallery/api/filled_step.py
+.. figure:: ../../gallery/api/images/sphx_glr_filled_step_001.png
+ :target: ../../gallery/api/filled_step.html
+ :align: center
+ :scale: 50
+
+ Filled Step
Square Plot
@@ -729,3 +744,6 @@ is important if your toolchain is prefixed. This is done in a simpilar
way as setting `CC` or `CXX` before building. An example follows.
export PKG_CONFIG=x86_64-pc-linux-gnu-pkg-config
+
+
+
diff --git a/doc/users/pyplot_tutorial.rst b/doc/users/pyplot_tutorial.rst
index 77ba9384d7d5..f588c65bc418 100644
--- a/doc/users/pyplot_tutorial.rst
+++ b/doc/users/pyplot_tutorial.rst
@@ -17,8 +17,12 @@ and in most places in the documentation refers to the *axes*
`part of a figure `__
and not the strict mathematical term for more than one axis).
-.. plot:: mpl_examples/pyplots/pyplot_simple.py
- :include-source:
+.. figure:: ../gallery/pyplots/images/sphx_glr_pyplot_simple_001.png
+ :target: ../gallery/pyplots/pyplot_simple.html
+ :align: center
+ :scale: 50
+
+ Pyplot Simple
You may be wondering why the x-axis ranges from 0-3 and the y-axis
from 1-4. If you provide a single list or array to the
@@ -41,8 +45,12 @@ MATLAB, and you concatenate a color string with a line style string.
The default format string is 'b-', which is a solid blue line. For
example, to plot the above with red circles, you would issue
-.. plot:: mpl_examples/pyplots/pyplot_formatstr.py
- :include-source:
+.. figure:: ../gallery/pyplots/images/sphx_glr_pyplot_formatstr_001.png
+ :target: ../gallery/pyplots/pyplot_formatstr.html
+ :align: center
+ :scale: 50
+
+ Pyplot Formatstr
See the :func:`~matplotlib.pyplot.plot` documentation for a complete
list of line styles and format strings. The
@@ -57,8 +65,12 @@ converted to numpy arrays internally. The example below illustrates a
plotting several lines with different format styles in one command
using arrays.
-.. plot:: mpl_examples/pyplots/pyplot_three.py
- :include-source:
+.. figure:: ../gallery/pyplots/images/sphx_glr_pyplot_three_001.png
+ :target: ../gallery/pyplots/pyplot_three.html
+ :align: center
+ :scale: 50
+
+ Pyplot Three
.. _controlling-line-properties:
@@ -164,8 +176,12 @@ current axes (a :class:`matplotlib.axes.Axes` instance), and
to worry about this, because it is all taken care of behind the
scenes. Below is a script to create two subplots.
-.. plot:: mpl_examples/pyplots/pyplot_two_subplots.py
- :include-source:
+.. figure:: ../gallery/pyplots/images/sphx_glr_pyplot_two_subplots_001.png
+ :target: ../gallery/pyplots/pyplot_two_subplots.html
+ :align: center
+ :scale: 50
+
+ Pyplot Two Subplots
The :func:`~matplotlib.pyplot.figure` command here is optional because
``figure(1)`` will be created by default, just as a ``subplot(111)``
@@ -231,8 +247,12 @@ an arbitrary location, and the :func:`~matplotlib.pyplot.xlabel`,
are used to add text in the indicated locations (see :ref:`text-intro`
for a more detailed example)
-.. plot:: mpl_examples/pyplots/pyplot_text.py
- :include-source:
+.. figure:: ../gallery/pyplots/images/sphx_glr_pyplot_text_001.png
+ :target: ../gallery/pyplots/pyplot_text.html
+ :align: center
+ :scale: 50
+
+ Pyplot Text
All of the :func:`~matplotlib.pyplot.text` commands return an
@@ -277,8 +297,12 @@ two points to consider: the location being annotated represented by
the argument ``xy`` and the location of the text ``xytext``. Both of
these arguments are ``(x,y)`` tuples.
-.. plot:: mpl_examples/pyplots/pyplot_annotate.py
- :include-source:
+.. figure:: ../gallery/pyplots/images/sphx_glr_pyplot_annotate_001.png
+ :target: ../gallery/pyplots/pyplot_annotate.html
+ :align: center
+ :scale: 50
+
+ Pyplot Annotate
In this basic example, both the ``xy`` (arrow tip) and ``xytext``
locations (text location) are in data coordinates. There are a
@@ -300,8 +324,19 @@ of magnitude. Changing the scale of an axis is easy:
An example of four plots with the same data and different scales for the y axis
is shown below.
-.. plot:: mpl_examples/pyplots/pyplot_scales.py
- :include-source:
+.. figure:: ../gallery/pyplots/images/sphx_glr_pyplot_scales_001.png
+ :target: ../gallery/pyplots/pyplot_scales.html
+ :align: center
+ :scale: 50
+
+ Pyplot Scales
It is also possible to add your own scale, see :ref:`adding-new-scales` for
details.
+
+
+
+
+
+
+
diff --git a/doc/users/screenshots.rst b/doc/users/screenshots.rst
index 635d8cf66ae5..93cd37b873ce 100644
--- a/doc/users/screenshots.rst
+++ b/doc/users/screenshots.rst
@@ -12,7 +12,12 @@ Simple Plot
Here's a very basic :func:`~matplotlib.pyplot.plot` with text labels:
-.. plot:: mpl_examples/pylab_examples/simple_plot.py
+.. figure:: ../gallery/pylab_examples/images/sphx_glr_simple_plot_001.png
+ :target: ../gallery/pylab_examples/simple_plot.html
+ :align: center
+ :scale: 50
+
+ Simple Plot
.. _screenshots_subplot_demo:
@@ -22,7 +27,12 @@ Subplot demo
Multiple axes (i.e. subplots) are created with the
:func:`~matplotlib.pyplot.subplot` command:
-.. plot:: gallery/subplots_axes_and_figures/subplot.py
+.. figure:: ../gallery/subplots_axes_and_figures/images/sphx_glr_subplot_001.png
+ :target: ../gallery/subplots_axes_and_figures/subplot.html
+ :align: center
+ :scale: 50
+
+ Subplot
.. _screenshots_histogram_demo:
@@ -32,7 +42,12 @@ Histograms
The :func:`~matplotlib.pyplot.hist` command automatically generates
histograms and returns the bin counts or probabilities:
-.. plot:: gallery/statistics/histogram_features.py
+.. figure:: ../gallery/statistics/images/sphx_glr_histogram_features_001.png
+ :target: ../gallery/statistics/histogram_features.html
+ :align: center
+ :scale: 50
+
+ Histogram Features
.. _screenshots_path_demo:
@@ -43,7 +58,12 @@ Path demo
You can add arbitrary paths in matplotlib using the
:mod:`matplotlib.path` module:
-.. plot:: gallery/shapes_and_collections/path_patch.py
+.. figure:: ../gallery/shapes_and_collections/images/sphx_glr_path_patch_001.png
+ :target: ../gallery/shapes_and_collections/path_patch.html
+ :align: center
+ :scale: 50
+
+ Path Patch
.. _screenshots_mplot3d_surface:
@@ -54,7 +74,12 @@ 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:: gallery/mplot3d/surface3d.py
+.. figure:: ../gallery/mplot3d/images/sphx_glr_surface3d_001.png
+ :target: ../gallery/mplot3d/surface3d.html
+ :align: center
+ :scale: 50
+
+ Surface3d
Thanks to John Porter, Jonathon Taylor, Reinier Heeres, and Ben Root for
the `mplot3d` toolkit. This toolkit is included with all standard matplotlib
@@ -71,7 +96,12 @@ 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/plot_streamplot.py
+.. figure:: ../gallery/images_contours_and_fields/images/sphx_glr_plot_streamplot_001.png
+ :target: ../gallery/images_contours_and_fields/plot_streamplot.html
+ :align: center
+ :scale: 50
+
+ Plot Streamplot
This feature complements the :meth:`~matplotlib.pyplot.quiver` function for
plotting vector fields. Thanks to Tom Flannaghan and Tony Yu for adding the
@@ -88,7 +118,12 @@ Michael Droettboom built on work by Charlie Moad to provide an extremely
accurate 8-spline approximation to elliptical arcs (see
:class:`~matplotlib.patches.Arc`), which are insensitive to zoom level.
-.. plot:: mpl_examples/pylab_examples/ellipse_demo.py
+.. figure:: ../gallery/pylab_examples/images/sphx_glr_ellipse_demo_001.png
+ :target: ../gallery/pylab_examples/ellipse_demo.html
+ :align: center
+ :scale: 50
+
+ Ellipse Demo
.. _screenshots_barchart_demo:
@@ -98,12 +133,17 @@ Bar charts
Bar charts are simple to create using the :func:`~matplotlib.pyplot.bar`
command, which includes customizations such as error bars:
-.. plot:: mpl_examples/pylab_examples/barchart_demo.py
+.. figure:: ../gallery/pylab_examples/images/sphx_glr_barchart_demo_001.png
+ :target: ../gallery/pylab_examples/barchart_demo.html
+ :align: center
+ :scale: 50
+
+ Barchart Demo
It's also simple to create stacked bars
-(`bar_stacked.py <../examples/pylab_examples/bar_stacked.html>`_),
+(`bar_stacked.py <../gallery/pylab_examples/bar_stacked.html>`_),
or horizontal bar charts
-(`barh.py <../examples/lines_bars_and_markers/barh.html>`_).
+(`barh.py <../gallery/lines_bars_and_markers/barh.html>`_).
.. _screenshots_pie_demo:
@@ -117,7 +157,12 @@ 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:: gallery/pie_and_polar_charts/pie_features.py
+.. figure:: ../gallery/pie_and_polar_charts/images/sphx_glr_pie_features_001.png
+ :target: ../gallery/pie_and_polar_charts/pie_features.html
+ :align: center
+ :scale: 50
+
+ Pie Features
.. _screenshots_table_demo:
@@ -127,7 +172,12 @@ Table demo
The :func:`~matplotlib.pyplot.table` command adds a text table
to an axes.
-.. plot:: mpl_examples/pylab_examples/table_demo.py
+.. figure:: ../gallery/pylab_examples/images/sphx_glr_table_demo_001.png
+ :target: ../gallery/pylab_examples/table_demo.html
+ :align: center
+ :scale: 50
+
+ Table Demo
.. _screenshots_scatter_demo:
@@ -142,7 +192,12 @@ in Google's stock price, with marker sizes reflecting the
trading volume and colors varying with time. Here, the
alpha attribute is used to make semitransparent circle markers.
-.. plot:: mpl_examples/pylab_examples/scatter_demo2.py
+.. figure:: ../gallery/pylab_examples/images/sphx_glr_scatter_demo2_001.png
+ :target: ../gallery/pylab_examples/scatter_demo2.html
+ :align: center
+ :scale: 50
+
+ Scatter Demo2
.. _screenshots_slider_demo:
@@ -153,9 +208,14 @@ Slider demo
Matplotlib has basic GUI widgets that are independent of the graphical
user interface you are using, allowing you to write cross GUI figures
and widgets. See :mod:`matplotlib.widgets` and the
-`widget examples <../examples/widgets/index.html>`_.
+`widget examples <../gallery/index.html>`_.
-.. plot:: mpl_examples/widgets/slider_demo.py
+.. figure:: ../gallery/widgets/images/sphx_glr_slider_demo_001.png
+ :target: ../gallery/widgets/slider_demo.html
+ :align: center
+ :scale: 50
+
+ Slider Demo
.. _screenshots_fill_demo:
@@ -166,7 +226,12 @@ Fill demo
The :func:`~matplotlib.pyplot.fill` command lets you
plot filled curves and polygons:
-.. plot:: gallery/lines_bars_and_markers/fill.py
+.. figure:: ../gallery/lines_bars_and_markers/images/sphx_glr_fill_001.png
+ :target: ../gallery/lines_bars_and_markers/fill.html
+ :align: center
+ :scale: 50
+
+ Fill
Thanks to Andrew Straw for adding this function.
@@ -178,7 +243,12 @@ Date demo
You can plot date data with major and minor ticks and custom tick formatters
for both.
-.. plot:: gallery/api/date.py
+.. figure:: ../gallery/api/images/sphx_glr_date_001.png
+ :target: ../gallery/api/date.html
+ :align: center
+ :scale: 50
+
+ Date
See :mod:`matplotlib.ticker` and :mod:`matplotlib.dates` for details and usage.
@@ -193,7 +263,12 @@ The :func:`~matplotlib.pyplot.semilogx`,
:func:`~matplotlib.pyplot.loglog` functions simplify the creation of
logarithmic plots.
-.. plot:: mpl_examples/pylab_examples/log_demo.py
+.. figure:: ../gallery/pylab_examples/images/sphx_glr_log_demo_001.png
+ :target: ../gallery/pylab_examples/log_demo.html
+ :align: center
+ :scale: 50
+
+ Log Demo
Thanks to Andrew Straw, Darren Dale and Gregory Lielens for contributions
log-scaling infrastructure.
@@ -205,7 +280,12 @@ Polar plots
The :func:`~matplotlib.pyplot.polar` command generates polar plots.
-.. plot:: mpl_examples/pylab_examples/polar_demo.py
+.. figure:: ../gallery/pylab_examples/images/sphx_glr_polar_demo_001.png
+ :target: ../gallery/pylab_examples/polar_demo.html
+ :align: center
+ :scale: 50
+
+ Polar Demo
.. _screenshots_legend_demo:
@@ -217,7 +297,12 @@ The :func:`~matplotlib.pyplot.legend` command automatically
generates figure legends, with MATLAB-compatible legend placement
commands.
-.. plot:: gallery/api/legend.py
+.. figure:: ../gallery/api/images/sphx_glr_legend_001.png
+ :target: ../gallery/api/legend.html
+ :align: center
+ :scale: 50
+
+ Legend
Thanks to Charles Twardy for input on the legend command.
@@ -232,7 +317,12 @@ expressions using `FreeType `_
and the DejaVu, BaKoMa computer modern, or `STIX `_
fonts. See the :mod:`matplotlib.mathtext` module for additional details.
-.. plot:: mpl_examples/pylab_examples/mathtext_examples.py
+.. figure:: ../gallery/pylab_examples/images/sphx_glr_mathtext_examples_001.png
+ :target: ../gallery/pylab_examples/mathtext_examples.html
+ :align: center
+ :scale: 50
+
+ Mathtext Examples
Matplotlib's mathtext infrastructure is an independent implementation and
does not require TeX or any external packages installed on your computer. See
@@ -248,7 +338,12 @@ Although matplotlib's internal math rendering engine is quite
powerful, sometimes you need TeX. Matplotlib supports external TeX
rendering of strings with the *usetex* option.
-.. plot:: mpl_examples/pyplots/tex_demo.py
+.. figure:: ../gallery/pyplots/images/sphx_glr_tex_demo_001.png
+ :target: ../gallery/pyplots/tex_demo.html
+ :align: center
+ :scale: 50
+
+ Tex Demo
.. _screenshots_eeg_demo:
@@ -278,4 +373,30 @@ XKCD-style sketch plots
matplotlib supports plotting in the style of `xkcd
`.
-.. plot:: gallery/showcase/xkcd.py
+.. figure:: ../gallery/showcase/images/sphx_glr_xkcd_001.png
+ :target: ../gallery/showcase/xkcd.html
+ :align: center
+ :scale: 50
+
+ Xkcd
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/doc/users/text_intro.rst b/doc/users/text_intro.rst
index 1075b0d58fed..93c30ef929c4 100644
--- a/doc/users/text_intro.rst
+++ b/doc/users/text_intro.rst
@@ -58,5 +58,11 @@ All of these functions create and return a
variety of font and other properties. The example below shows all of
these commands in action.
-.. plot:: mpl_examples/pyplots/text_commands.py
- :include-source:
+.. figure:: ../gallery/pyplots/images/sphx_glr_text_commands_001.png
+ :target: ../gallery/pyplots/text_commands.html
+ :align: center
+ :scale: 50
+
+ Text Commands
+
+
diff --git a/doc/users/text_props.rst b/doc/users/text_props.rst
index 6ec9c5047147..75e3496b9cba 100644
--- a/doc/users/text_props.rst
+++ b/doc/users/text_props.rst
@@ -58,8 +58,12 @@ code indicates that the coordinates are given relative to the axes
bounding box, with 0,0 being the lower left of the axes and 1,1 the
upper right.
-.. plot:: mpl_examples/pyplots/text_layout.py
- :include-source:
+.. figure:: ../gallery/pyplots/images/sphx_glr_text_layout_001.png
+ :target: ../gallery/pyplots/text_layout.html
+ :align: center
+ :scale: 50
+
+ Text Layout
==============
@@ -155,3 +159,4 @@ useful tool to discover the font name; for example ::
Noto Sans CJK SC,Noto Sans CJK SC Light
lists all of the fonts that support Chinese.
+
diff --git a/doc/users/transforms_tutorial.rst b/doc/users/transforms_tutorial.rst
index fc3e574f190a..57aacb1c5c93 100644
--- a/doc/users/transforms_tutorial.rst
+++ b/doc/users/transforms_tutorial.rst
@@ -112,7 +112,12 @@ dpi setting. Likewise, in the figure below, the display labeled
points are probably not the same as in the ipython session because the
documentation figure size defaults are different.
-.. plot:: mpl_examples/pyplots/annotate_transform.py
+.. figure:: ../gallery/pyplots/images/sphx_glr_annotate_transform_001.png
+ :target: ../gallery/pyplots/annotate_transform.html
+ :align: center
+ :scale: 50
+
+ Annotate Transform
.. note::
@@ -453,3 +458,4 @@ see how to make your own, since matplotlib supports extensible axes
and projections. Michael Droettboom has provided a nice tutorial
example of creating a hammer projection axes; see
:ref:`api-custom_projection_example`.
+
diff --git a/doc/users/usetex.rst b/doc/users/usetex.rst
index b094d572918b..64c678f92633 100644
--- a/doc/users/usetex.rst
+++ b/doc/users/usetex.rst
@@ -52,8 +52,12 @@ matplotlibrc use::
Here is the standard example, `tex_demo.py`:
-.. plot:: mpl_examples/pyplots/tex_demo.py
- :include-source:
+.. figure:: ../gallery/pyplots/images/sphx_glr_tex_demo_001.png
+ :target: ../gallery/pyplots/tex_demo.html
+ :align: center
+ :scale: 50
+
+ Tex Demo
Note that display math mode (``$$ e=mc^2 $$``) is not supported, but adding the
command ``\displaystyle``, as in `tex_demo.py`, will produce the same
@@ -74,8 +78,12 @@ usetex with unicode
It is also possible to use unicode strings with the LaTeX text manager, here is
an example taken from `tex_unicode_demo.py`:
-.. plot:: mpl_examples/pylab_examples/tex_unicode_demo.py
- :include-source:
+.. figure:: ../gallery/pylab_examples/images/sphx_glr_tex_unicode_demo_001.png
+ :target: ../gallery/pylab_examples/tex_unicode_demo.html
+ :align: center
+ :scale: 50
+
+ Tex Unicode Demo
.. _usetex-postscript:
@@ -156,3 +164,5 @@ Troubleshooting
.. _PSNFSS: http://www.ctan.org/tex-archive/macros/latex/required/psnfss/psnfss2e.pdf
.. _Poppler: https://poppler.freedesktop.org/
.. _Xpdf: http://www.foolabs.com/xpdf
+
+
diff --git a/doc/users/whats_new/multiple_legend_keys.rst b/doc/users/whats_new/multiple_legend_keys.rst
index 9be34e4b36a7..0eadb3012b57 100644
--- a/doc/users/whats_new/multiple_legend_keys.rst
+++ b/doc/users/whats_new/multiple_legend_keys.rst
@@ -6,5 +6,11 @@ A legend entry can now contain more than one legend key. The extended
legend area in the specified number of sections; ``pad`` changes the padding
between the legend keys.
-.. plot:: mpl_examples/pylab_examples/legend_demo6.py
+.. figure:: ../../gallery/pylab_examples/images/sphx_glr_legend_demo6_001.png
+ :target: ../../gallery/pylab_examples/legend_demo6.html
+ :align: center
+ :scale: 50
+
+ Legend Demo6
+
diff --git a/examples/README.txt b/examples/README.txt
index dd11d83fb080..e7a91d293b0d 100644
--- a/examples/README.txt
+++ b/examples/README.txt
@@ -1,3 +1,5 @@
+.. _examples-index:
+
.. _gallery:
Gallery
@@ -5,5 +7,3 @@ Gallery
This gallery contains examples of the many things you can do with
Matplotlib. Click on any image to see the full image and source code.
-
-.. contents::
diff --git a/examples/animation/README.txt b/examples/animation/README.txt
index 1b98a386fa8a..dc7aa310c37e 100644
--- a/examples/animation/README.txt
+++ b/examples/animation/README.txt
@@ -1,4 +1,6 @@
.. _animation_examples:
+.. _animation-examples-index:
+
Animation Examples
==================
diff --git a/examples/animation/bayes_update.py b/examples/animation/bayes_update_sgskip.py
similarity index 100%
rename from examples/animation/bayes_update.py
rename to examples/animation/bayes_update_sgskip.py
diff --git a/examples/animation/double_pendulum_animated.py b/examples/animation/double_pendulum_animated_sgskip.py
similarity index 93%
rename from examples/animation/double_pendulum_animated.py
rename to examples/animation/double_pendulum_animated_sgskip.py
index 56af089bbb6f..c24c52c5ef33 100644
--- a/examples/animation/double_pendulum_animated.py
+++ b/examples/animation/double_pendulum_animated_sgskip.py
@@ -1,13 +1,15 @@
"""
+.. _animation-double_pendulum_animated:
+
===========================
The double pendulum problem
===========================
This animation illustrates the double pendulum problem.
-"""
-# Double pendulum formula translated from the C code at
-# http://www.physics.usyd.edu.au/~wheat/dpend_html/solve_dpend.c
+Double pendulum formula translated from the C code at
+http://www.physics.usyd.edu.au/~wheat/dpend_html/solve_dpend.c
+"""
from numpy import sin, cos
import numpy as np
diff --git a/examples/animation/subplots.py b/examples/animation/subplots.py
index 9af8296471a1..96077a7eb56b 100644
--- a/examples/animation/subplots.py
+++ b/examples/animation/subplots.py
@@ -1,4 +1,6 @@
"""
+.. _animation-subplots:
+
=================
Animated subplots
=================
diff --git a/examples/api/custom_projection_example.py b/examples/api/custom_projection_example.py
index 1747027146ba..98fb2e7294c3 100644
--- a/examples/api/custom_projection_example.py
+++ b/examples/api/custom_projection_example.py
@@ -1,4 +1,6 @@
"""
+.. _api-custom_projection_example:
+
=================
Custom projection
=================
diff --git a/examples/api/legend.py b/examples/api/legend.py
index de50130d2224..4f518efa0850 100644
--- a/examples/api/legend.py
+++ b/examples/api/legend.py
@@ -1,4 +1,6 @@
"""
+.. _api-legend:
+
===============================
Legend using pre-defined labels
===============================
diff --git a/examples/api/sankey_basics.py b/examples/api/sankey_basics.py
index b582fcfeee8a..fe1c78e9f662 100644
--- a/examples/api/sankey_basics.py
+++ b/examples/api/sankey_basics.py
@@ -1,4 +1,6 @@
"""
+.. _api-sankey_basics:
+
================
The Sankey class
================
diff --git a/examples/api/sankey_links.py b/examples/api/sankey_links.py
index b8de4744edb3..45c2defbfdb9 100644
--- a/examples/api/sankey_links.py
+++ b/examples/api/sankey_links.py
@@ -1,4 +1,6 @@
"""
+.. _api-sankey_links:
+
======================================
Long chain of connections using Sankey
======================================
diff --git a/examples/api/sankey_rankine.py b/examples/api/sankey_rankine.py
index 59f1174184a6..d08265e4ddbc 100644
--- a/examples/api/sankey_rankine.py
+++ b/examples/api/sankey_rankine.py
@@ -1,4 +1,6 @@
"""
+.. _api-sankey_rankine:
+
===================
Rankine power cycle
===================
diff --git a/examples/api/two_scales.py b/examples/api/two_scales.py
index ca5b4eddfbaa..0d20cab0fcc3 100644
--- a/examples/api/two_scales.py
+++ b/examples/api/two_scales.py
@@ -1,4 +1,6 @@
"""
+.. _api-two_scales:
+
===========================
Plots with different scales
===========================
diff --git a/examples/axes_grid1/README.txt b/examples/axes_grid1/README.txt
index 2f37192b2567..5c3c5d14ec96 100644
--- a/examples/axes_grid1/README.txt
+++ b/examples/axes_grid1/README.txt
@@ -1,4 +1,6 @@
.. _axes_grid_examples:
+.. _axes_grid1-examples-index:
+
Axes Grid
=========
diff --git a/doc/mpl_toolkits/axes_grid1/figures/demo_colorbar_of_inset_axes.py b/examples/axes_grid1/demo_colorbar_of_inset_axes.py
similarity index 92%
rename from doc/mpl_toolkits/axes_grid1/figures/demo_colorbar_of_inset_axes.py
rename to examples/axes_grid1/demo_colorbar_of_inset_axes.py
index 326fefef6323..6543f4b7b93f 100644
--- a/doc/mpl_toolkits/axes_grid1/figures/demo_colorbar_of_inset_axes.py
+++ b/examples/axes_grid1/demo_colorbar_of_inset_axes.py
@@ -1,3 +1,9 @@
+"""
+===========================
+Demo Colorbar of Inset Axes
+===========================
+
+"""
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1.inset_locator import inset_axes, zoomed_inset_axes
diff --git a/doc/mpl_toolkits/axes_grid1/figures/demo_colorbar_with_axes_divider.py b/examples/axes_grid1/demo_colorbar_with_axes_divider.py
similarity index 87%
rename from doc/mpl_toolkits/axes_grid1/figures/demo_colorbar_with_axes_divider.py
rename to examples/axes_grid1/demo_colorbar_with_axes_divider.py
index e73f0c95c93f..0e98558d0435 100644
--- a/doc/mpl_toolkits/axes_grid1/figures/demo_colorbar_with_axes_divider.py
+++ b/examples/axes_grid1/demo_colorbar_with_axes_divider.py
@@ -1,3 +1,9 @@
+"""
+===============================
+Demo Colorbar with Axes Divider
+===============================
+
+"""
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1.axes_divider import make_axes_locatable
diff --git a/doc/mpl_toolkits/axes_grid1/figures/demo_fixed_size_axes.py b/examples/axes_grid1/demo_fixed_size_axes.py
similarity index 94%
rename from doc/mpl_toolkits/axes_grid1/figures/demo_fixed_size_axes.py
rename to examples/axes_grid1/demo_fixed_size_axes.py
index 7c235b477ccc..600b0162b92b 100644
--- a/doc/mpl_toolkits/axes_grid1/figures/demo_fixed_size_axes.py
+++ b/examples/axes_grid1/demo_fixed_size_axes.py
@@ -1,3 +1,9 @@
+"""
+====================
+Demo Fixed Size Axes
+====================
+
+"""
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import Divider, LocatableAxes, Size
diff --git a/doc/mpl_toolkits/axes_grid1/figures/demo_new_colorbar.py b/examples/axes_grid1/demo_new_colorbar.py
similarity index 89%
rename from doc/mpl_toolkits/axes_grid1/figures/demo_new_colorbar.py
rename to examples/axes_grid1/demo_new_colorbar.py
index de5d3e0de0c4..7e165e82f37f 100644
--- a/doc/mpl_toolkits/axes_grid1/figures/demo_new_colorbar.py
+++ b/examples/axes_grid1/demo_new_colorbar.py
@@ -1,3 +1,9 @@
+"""
+=================
+Demo New Colorbar
+=================
+
+"""
import matplotlib.pyplot as plt
plt.rcParams["text.usetex"]=False
diff --git a/doc/mpl_toolkits/axes_grid1/figures/parasite_simple.py b/examples/axes_grid1/parasite_simple.py
similarity index 90%
rename from doc/mpl_toolkits/axes_grid1/figures/parasite_simple.py
rename to examples/axes_grid1/parasite_simple.py
index c66d3c2ce302..4a1a3fbd25f6 100644
--- a/doc/mpl_toolkits/axes_grid1/figures/parasite_simple.py
+++ b/examples/axes_grid1/parasite_simple.py
@@ -1,3 +1,9 @@
+"""
+===============
+Parasite Simple
+===============
+
+"""
from mpl_toolkits.axes_grid1 import host_subplot
import matplotlib.pyplot as plt
diff --git a/doc/mpl_toolkits/axes_grid1/figures/simple_axes_divider1.py b/examples/axes_grid1/simple_axes_divider1.py
similarity index 92%
rename from doc/mpl_toolkits/axes_grid1/figures/simple_axes_divider1.py
rename to examples/axes_grid1/simple_axes_divider1.py
index 94149d082305..4ee374b53f67 100644
--- a/doc/mpl_toolkits/axes_grid1/figures/simple_axes_divider1.py
+++ b/examples/axes_grid1/simple_axes_divider1.py
@@ -1,3 +1,9 @@
+"""
+=====================
+Simple Axes Divider 1
+=====================
+
+"""
from mpl_toolkits.axes_grid1 import Size, Divider
import matplotlib.pyplot as plt
diff --git a/doc/mpl_toolkits/axes_grid1/figures/simple_axes_divider2.py b/examples/axes_grid1/simple_axes_divider2.py
similarity index 92%
rename from doc/mpl_toolkits/axes_grid1/figures/simple_axes_divider2.py
rename to examples/axes_grid1/simple_axes_divider2.py
index 76198796c131..6e1ecc0a4197 100644
--- a/doc/mpl_toolkits/axes_grid1/figures/simple_axes_divider2.py
+++ b/examples/axes_grid1/simple_axes_divider2.py
@@ -1,3 +1,9 @@
+"""
+=====================
+Simple Axes Divider 2
+=====================
+
+"""
import mpl_toolkits.axes_grid1.axes_size as Size
from mpl_toolkits.axes_grid1 import Divider
import matplotlib.pyplot as plt
diff --git a/doc/mpl_toolkits/axes_grid1/figures/simple_axes_divider3.py b/examples/axes_grid1/simple_axes_divider3.py
similarity index 93%
rename from doc/mpl_toolkits/axes_grid1/figures/simple_axes_divider3.py
rename to examples/axes_grid1/simple_axes_divider3.py
index 408fa5247b63..550afa72b1ca 100644
--- a/doc/mpl_toolkits/axes_grid1/figures/simple_axes_divider3.py
+++ b/examples/axes_grid1/simple_axes_divider3.py
@@ -1,3 +1,9 @@
+"""
+=====================
+Simple Axes Divider 3
+=====================
+
+"""
import mpl_toolkits.axes_grid1.axes_size as Size
from mpl_toolkits.axes_grid1 import Divider
import matplotlib.pyplot as plt
diff --git a/doc/mpl_toolkits/axes_grid1/figures/simple_colorbar.py b/examples/axes_grid1/simple_colorbar.py
similarity index 88%
rename from doc/mpl_toolkits/axes_grid1/figures/simple_colorbar.py
rename to examples/axes_grid1/simple_colorbar.py
index c2f67d9a16e9..ec9746624460 100644
--- a/doc/mpl_toolkits/axes_grid1/figures/simple_colorbar.py
+++ b/examples/axes_grid1/simple_colorbar.py
@@ -1,3 +1,9 @@
+"""
+===============
+Simple Colorbar
+===============
+
+"""
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
import numpy as np
diff --git a/doc/mpl_toolkits/axes_grid1/figures/simple_rgb.py b/examples/axes_grid1/simple_rgb.py
similarity index 94%
rename from doc/mpl_toolkits/axes_grid1/figures/simple_rgb.py
rename to examples/axes_grid1/simple_rgb.py
index 14379d3b9d45..6dd40df285f3 100644
--- a/doc/mpl_toolkits/axes_grid1/figures/simple_rgb.py
+++ b/examples/axes_grid1/simple_rgb.py
@@ -1,3 +1,9 @@
+"""
+==========
+Simple RGB
+==========
+
+"""
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1.axes_rgb import RGBAxes
diff --git a/examples/axisartist/README.txt b/examples/axisartist/README.txt
index 38316367539f..d6b190aedaf0 100644
--- a/examples/axisartist/README.txt
+++ b/examples/axisartist/README.txt
@@ -1,4 +1,6 @@
.. _axis_artist_examples:
+.. _axisartist-examples-index:
+
Axis Artist
===========
diff --git a/doc/users/plotting/colormaps/colormaps.py b/examples/color/colormaps.py
similarity index 95%
rename from doc/users/plotting/colormaps/colormaps.py
rename to examples/color/colormaps.py
index 38ed1a312776..f6462d2e9d24 100644
--- a/doc/users/plotting/colormaps/colormaps.py
+++ b/examples/color/colormaps.py
@@ -1,3 +1,10 @@
+"""
+=================
+List of Colormaps
+=================
+
+"""
+
# Have colormaps separated into categories:
# http://matplotlib.org/examples/color/colormaps_reference.html
diff --git a/examples/color/colormaps_reference.py b/examples/color/colormaps_reference.py
index 7f1add877d3e..876b9822cd81 100644
--- a/examples/color/colormaps_reference.py
+++ b/examples/color/colormaps_reference.py
@@ -1,4 +1,6 @@
"""
+.. _color-colormaps_reference:
+
==================
Colormap reference
==================
diff --git a/doc/users/plotting/colormaps/grayscale.py b/examples/color/grayscale.py
similarity index 100%
rename from doc/users/plotting/colormaps/grayscale.py
rename to examples/color/grayscale.py
diff --git a/doc/users/plotting/colormaps/lightness.py b/examples/color/lightness.py
similarity index 100%
rename from doc/users/plotting/colormaps/lightness.py
rename to examples/color/lightness.py
diff --git a/examples/lines_bars_and_markers/marker_reference.py b/examples/lines_bars_and_markers/marker_reference.py
index 7927bbe612a6..4c00ef16a37e 100644
--- a/examples/lines_bars_and_markers/marker_reference.py
+++ b/examples/lines_bars_and_markers/marker_reference.py
@@ -1,4 +1,6 @@
"""
+.. _lines_bars_and_markers-marker_reference:
+
================================
Filled and unfilled-marker types
================================
diff --git a/examples/lines_bars_and_markers/scatter_with_legend.py b/examples/lines_bars_and_markers/scatter_with_legend.py
index bca9215ef8aa..5145184f580c 100644
--- a/examples/lines_bars_and_markers/scatter_with_legend.py
+++ b/examples/lines_bars_and_markers/scatter_with_legend.py
@@ -1,4 +1,6 @@
-'''
+"""
+.. _lines_bars_and_markers-scatter_with_legend:
+
===========================
Scatter plots with a legend
===========================
@@ -6,7 +8,7 @@
Also demonstrates how transparency of the markers
can be adjusted by giving ``alpha`` a value between
0 and 1.
-'''
+"""
import matplotlib.pyplot as plt
from numpy.random import rand
diff --git a/examples/misc/README.txt b/examples/misc/README.txt
index a2bd476977f0..4f4043f4a567 100644
--- a/examples/misc/README.txt
+++ b/examples/misc/README.txt
@@ -1,2 +1,4 @@
+.. _misc-examples-index:
+
Miscellaneous Examples
======================
diff --git a/examples/mplot3d/README.txt b/examples/mplot3d/README.txt
index 7a7402f9c8d2..55875df70a1f 100644
--- a/examples/mplot3d/README.txt
+++ b/examples/mplot3d/README.txt
@@ -1,4 +1,6 @@
.. _mplot3d_example:
+.. _mplot3d-examples-index:
+
mplot3d toolkit
===============
diff --git a/examples/pylab_examples/animation_demo.py b/examples/pylab_examples/animation_demo.py
index 76f7b9804d3e..a59009910cd3 100644
--- a/examples/pylab_examples/animation_demo.py
+++ b/examples/pylab_examples/animation_demo.py
@@ -1,4 +1,6 @@
"""
+.. _pylab_examples-animation_demo:
+
==============
Animation Demo
==============
diff --git a/examples/pylab_examples/annotation_demo.py b/examples/pylab_examples/annotation_demo.py
index b514626c64e0..9696a575daa4 100644
--- a/examples/pylab_examples/annotation_demo.py
+++ b/examples/pylab_examples/annotation_demo.py
@@ -1,4 +1,6 @@
"""
+.. _pylab_examples-annotation_demo:
+
===============
Annotation Demo
===============
diff --git a/examples/pylab_examples/annotation_demo3.py b/examples/pylab_examples/annotation_demo3.py
index 6baa8e7f8609..1ef39710d89c 100644
--- a/examples/pylab_examples/annotation_demo3.py
+++ b/examples/pylab_examples/annotation_demo3.py
@@ -1,4 +1,6 @@
"""
+.. _pylab_examples-annotation_demo3:
+
================
Annotation Demo3
================
diff --git a/examples/pylab_examples/axes_demo.py b/examples/pylab_examples/axes_demo.py
index e57496522f4d..fb7aa0b3a064 100644
--- a/examples/pylab_examples/axes_demo.py
+++ b/examples/pylab_examples/axes_demo.py
@@ -1,4 +1,6 @@
"""
+.. _pylab_examples-axes_demo:
+
=========
Axes Demo
=========
diff --git a/examples/pylab_examples/axhspan_demo.py b/examples/pylab_examples/axhspan_demo.py
index c9cbf3d81a37..4cfe6249a564 100644
--- a/examples/pylab_examples/axhspan_demo.py
+++ b/examples/pylab_examples/axhspan_demo.py
@@ -1,4 +1,6 @@
"""
+.. _pylab_examples-axhspan_demo:
+
============
Axhspan Demo
============
diff --git a/examples/pylab_examples/contourf_hatching.py b/examples/pylab_examples/contourf_hatching.py
index e28a64a886bd..2fca24e8e492 100644
--- a/examples/pylab_examples/contourf_hatching.py
+++ b/examples/pylab_examples/contourf_hatching.py
@@ -1,4 +1,6 @@
"""
+.. _pylab_examples-contourf_hatching:
+
=================
Contourf Hatching
=================
diff --git a/examples/pylab_examples/demo_text_path.py b/examples/pylab_examples/demo_text_path_sgskip.py
similarity index 100%
rename from examples/pylab_examples/demo_text_path.py
rename to examples/pylab_examples/demo_text_path_sgskip.py
diff --git a/examples/pylab_examples/ellipse_demo.py b/examples/pylab_examples/ellipse_demo.py
index 1d37cd8f6635..18606fa55fb4 100644
--- a/examples/pylab_examples/ellipse_demo.py
+++ b/examples/pylab_examples/ellipse_demo.py
@@ -13,8 +13,7 @@
ells = [Ellipse(xy=rnd.rand(2)*10, width=rnd.rand(), height=rnd.rand(), angle=rnd.rand()*360)
for i in range(NUM)]
-fig = plt.figure(0)
-ax = fig.add_subplot(111, aspect='equal')
+fig, ax = plt.subplots(subplot_kw={'aspect': 'equal'})
for e in ells:
ax.add_artist(e)
e.set_clip_box(ax.bbox)
diff --git a/examples/pylab_examples/figlegend_demo.py b/examples/pylab_examples/figlegend_demo.py
index ddb52d550e81..39e7fd3d1481 100644
--- a/examples/pylab_examples/figlegend_demo.py
+++ b/examples/pylab_examples/figlegend_demo.py
@@ -1,4 +1,6 @@
"""
+.. _pylab_examples-figlegend_demo:
+
==================
Figure legend demo
==================
diff --git a/examples/pylab_examples/major_minor_demo1.py b/examples/pylab_examples/major_minor_demo1.py
index 9b216626a4fe..d5637d4e3efb 100644
--- a/examples/pylab_examples/major_minor_demo1.py
+++ b/examples/pylab_examples/major_minor_demo1.py
@@ -1,4 +1,6 @@
"""
+.. _pylab_examples-major_minor_demo1:
+
=================
Major Minor Demo1
=================
diff --git a/examples/pylab_examples/psd_demo2.py b/examples/pylab_examples/psd_demo2.py
index 33d3c1ba0513..7eed88a69f4a 100644
--- a/examples/pylab_examples/psd_demo2.py
+++ b/examples/pylab_examples/psd_demo2.py
@@ -1,4 +1,6 @@
"""
+.. _pylab_examples-psd_demo2:
+
=========
Psd Demo2
=========
diff --git a/examples/pylab_examples/psd_demo3.py b/examples/pylab_examples/psd_demo3.py
index 68506b3a23bf..22190517fb11 100644
--- a/examples/pylab_examples/psd_demo3.py
+++ b/examples/pylab_examples/psd_demo3.py
@@ -1,4 +1,6 @@
"""
+.. _pylab_examples-psd_demo3:
+
=========
Psd Demo3
=========
diff --git a/examples/pylab_examples/scatter_symbol.py b/examples/pylab_examples/scatter_symbol.py
index c9caaeb94339..8d24da24d451 100644
--- a/examples/pylab_examples/scatter_symbol.py
+++ b/examples/pylab_examples/scatter_symbol.py
@@ -1,4 +1,6 @@
"""
+.. _pylab_examples-scatter_symbol:
+
==============
Scatter Symbol
==============
diff --git a/examples/pylab_examples/spine_placement_demo.py b/examples/pylab_examples/spine_placement_demo.py
index 3dc6b1f281d9..05ca07912898 100644
--- a/examples/pylab_examples/spine_placement_demo.py
+++ b/examples/pylab_examples/spine_placement_demo.py
@@ -1,4 +1,6 @@
"""
+.. _pylab_examples-spine_placement_demo:
+
====================
Spine Placement Demo
====================
diff --git a/examples/pylab_examples/subplot_demo.py b/examples/pylab_examples/subplot_demo.py
index 0f77d69e2a4e..7fc0aa5eaf3d 100644
--- a/examples/pylab_examples/subplot_demo.py
+++ b/examples/pylab_examples/subplot_demo.py
@@ -1,4 +1,6 @@
"""
+.. _pylab_examples-subplots_demo:
+
============
Subplot Demo
============
diff --git a/examples/pylab_examples/zorder_demo.py b/examples/pylab_examples/zorder_demo.py
index c552a4a56fa2..0bdce5a23818 100644
--- a/examples/pylab_examples/zorder_demo.py
+++ b/examples/pylab_examples/zorder_demo.py
@@ -1,4 +1,6 @@
"""
+.. _pylab_examples-zorder_demo:
+
===========
Zorder Demo
===========
diff --git a/examples/pyplots/README.txt b/examples/pyplots/README.txt
new file mode 100644
index 000000000000..5d2b29c2ab7a
--- /dev/null
+++ b/examples/pyplots/README.txt
@@ -0,0 +1,4 @@
+.. _pyplots_examples:
+
+Pyplot Examples
+===============
diff --git a/examples/scales/README.txt b/examples/scales/README.txt
new file mode 100644
index 000000000000..a4f5ba184d26
--- /dev/null
+++ b/examples/scales/README.txt
@@ -0,0 +1,6 @@
+.. _scales_examples:
+
+Scales in Matplotlib
+====================
+
+These examples cover how different scales are handled in Matplotlib.
diff --git a/examples/statistics/boxplot.py b/examples/statistics/boxplot.py
index 356b8d5ab46f..3f34a0beb4ca 100644
--- a/examples/statistics/boxplot.py
+++ b/examples/statistics/boxplot.py
@@ -1,4 +1,6 @@
"""
+.. _statistics-boxplot:
+
=========================================
Demo of artist customization in box plots
=========================================
diff --git a/examples/statistics/bxp.py b/examples/statistics/bxp.py
index bb06214f778a..838fd8d118eb 100644
--- a/examples/statistics/bxp.py
+++ b/examples/statistics/bxp.py
@@ -1,4 +1,6 @@
"""
+.. _statistics-bxp:
+
===================================
Demo of the boxplot drawer function
===================================
diff --git a/examples/subplots_axes_and_figures/equal_aspect_ratio.py b/examples/subplots_axes_and_figures/equal_aspect_ratio.py
index 86ebd5bc83fd..7b8a742c93c2 100644
--- a/examples/subplots_axes_and_figures/equal_aspect_ratio.py
+++ b/examples/subplots_axes_and_figures/equal_aspect_ratio.py
@@ -1,4 +1,6 @@
"""
+.. _subplots_axes_and_figures-equal_aspect_ratio:
+
=================
Equal aspect axes
=================
diff --git a/examples/units/README.txt b/examples/units/README.txt
new file mode 100644
index 000000000000..7079b0edc47a
--- /dev/null
+++ b/examples/units/README.txt
@@ -0,0 +1,7 @@
+.. _units_examples:
+
+Units in Matplotlib
+===================
+
+These examples cover the many representations of units
+in Matplotlib.
diff --git a/examples/userdemo/README.txt b/examples/userdemo/README.txt
new file mode 100644
index 000000000000..7be351dc70dd
--- /dev/null
+++ b/examples/userdemo/README.txt
@@ -0,0 +1,4 @@
+.. _userdemo:
+
+Userdemo
+========
diff --git a/doc/users/plotting/examples/anchored_box01.py b/examples/userdemo/anchored_box01.py
similarity index 86%
rename from doc/users/plotting/examples/anchored_box01.py
rename to examples/userdemo/anchored_box01.py
index 509e6acf0962..31496c2e1086 100644
--- a/doc/users/plotting/examples/anchored_box01.py
+++ b/examples/userdemo/anchored_box01.py
@@ -1,3 +1,9 @@
+"""
+==============
+Anchored Box01
+==============
+
+"""
import matplotlib.pyplot as plt
from matplotlib.offsetbox import AnchoredText
diff --git a/doc/users/plotting/examples/anchored_box02.py b/examples/userdemo/anchored_box02.py
similarity index 89%
rename from doc/users/plotting/examples/anchored_box02.py
rename to examples/userdemo/anchored_box02.py
index d2a2ed7b3e5c..88656f1150c2 100644
--- a/doc/users/plotting/examples/anchored_box02.py
+++ b/examples/userdemo/anchored_box02.py
@@ -1,3 +1,9 @@
+"""
+==============
+Anchored Box02
+==============
+
+"""
from matplotlib.patches import Circle
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1.anchored_artists import AnchoredDrawingArea
diff --git a/doc/users/plotting/examples/anchored_box03.py b/examples/userdemo/anchored_box03.py
similarity index 88%
rename from doc/users/plotting/examples/anchored_box03.py
rename to examples/userdemo/anchored_box03.py
index 371ec9f68052..b29d7c671244 100644
--- a/doc/users/plotting/examples/anchored_box03.py
+++ b/examples/userdemo/anchored_box03.py
@@ -1,3 +1,9 @@
+"""
+==============
+Anchored Box03
+==============
+
+"""
from matplotlib.patches import Ellipse
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1.anchored_artists import AnchoredAuxTransformBox
diff --git a/doc/users/plotting/examples/anchored_box04.py b/examples/userdemo/anchored_box04.py
similarity index 95%
rename from doc/users/plotting/examples/anchored_box04.py
rename to examples/userdemo/anchored_box04.py
index 570c73162141..50567b834859 100644
--- a/doc/users/plotting/examples/anchored_box04.py
+++ b/examples/userdemo/anchored_box04.py
@@ -1,3 +1,9 @@
+"""
+==============
+Anchored Box04
+==============
+
+"""
from matplotlib.patches import Ellipse
import matplotlib.pyplot as plt
from matplotlib.offsetbox import AnchoredOffsetbox, TextArea, DrawingArea, HPacker
diff --git a/doc/users/plotting/examples/annotate_explain.py b/examples/userdemo/annotate_explain.py
similarity index 98%
rename from doc/users/plotting/examples/annotate_explain.py
rename to examples/userdemo/annotate_explain.py
index 12cc94e2aa70..98f8e72fb342 100644
--- a/doc/users/plotting/examples/annotate_explain.py
+++ b/examples/userdemo/annotate_explain.py
@@ -1,3 +1,9 @@
+"""
+================
+Annotate Explain
+================
+
+"""
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
diff --git a/doc/users/plotting/examples/annotate_simple01.py b/examples/userdemo/annotate_simple01.py
similarity index 83%
rename from doc/users/plotting/examples/annotate_simple01.py
rename to examples/userdemo/annotate_simple01.py
index 1a376b66f5b0..f8df8cd7a2fd 100644
--- a/doc/users/plotting/examples/annotate_simple01.py
+++ b/examples/userdemo/annotate_simple01.py
@@ -1,3 +1,9 @@
+"""
+=================
+Annotate Simple01
+=================
+
+"""
import matplotlib.pyplot as plt
plt.figure(1, figsize=(3,3))
diff --git a/doc/users/plotting/examples/annotate_simple02.py b/examples/userdemo/annotate_simple02.py
similarity index 85%
rename from doc/users/plotting/examples/annotate_simple02.py
rename to examples/userdemo/annotate_simple02.py
index 25bb0002de5f..ae0fd9233947 100644
--- a/doc/users/plotting/examples/annotate_simple02.py
+++ b/examples/userdemo/annotate_simple02.py
@@ -1,3 +1,9 @@
+"""
+=================
+Annotate Simple02
+=================
+
+"""
import matplotlib.pyplot as plt
plt.figure(1, figsize=(3,3))
diff --git a/doc/users/plotting/examples/annotate_simple03.py b/examples/userdemo/annotate_simple03.py
similarity index 89%
rename from doc/users/plotting/examples/annotate_simple03.py
rename to examples/userdemo/annotate_simple03.py
index 61a885afd2a5..f40c410a35aa 100644
--- a/doc/users/plotting/examples/annotate_simple03.py
+++ b/examples/userdemo/annotate_simple03.py
@@ -1,3 +1,9 @@
+"""
+=================
+Annotate Simple03
+=================
+
+"""
import matplotlib.pyplot as plt
plt.figure(1, figsize=(3,3))
diff --git a/doc/users/plotting/examples/annotate_simple04.py b/examples/userdemo/annotate_simple04.py
similarity index 94%
rename from doc/users/plotting/examples/annotate_simple04.py
rename to examples/userdemo/annotate_simple04.py
index cdbb1d804175..9d34bf71ac56 100644
--- a/doc/users/plotting/examples/annotate_simple04.py
+++ b/examples/userdemo/annotate_simple04.py
@@ -1,3 +1,9 @@
+"""
+=================
+Annotate Simple04
+=================
+
+"""
import matplotlib.pyplot as plt
plt.figure(1, figsize=(3,3))
diff --git a/doc/users/plotting/examples/annotate_simple_coord01.py b/examples/userdemo/annotate_simple_coord01.py
similarity index 86%
rename from doc/users/plotting/examples/annotate_simple_coord01.py
rename to examples/userdemo/annotate_simple_coord01.py
index 7b53d0c22973..028aebf1412d 100644
--- a/doc/users/plotting/examples/annotate_simple_coord01.py
+++ b/examples/userdemo/annotate_simple_coord01.py
@@ -1,3 +1,9 @@
+"""
+=======================
+Annotate Simple Coord01
+=======================
+
+"""
import matplotlib.pyplot as plt
diff --git a/doc/users/plotting/examples/annotate_simple_coord02.py b/examples/userdemo/annotate_simple_coord02.py
similarity index 87%
rename from doc/users/plotting/examples/annotate_simple_coord02.py
rename to examples/userdemo/annotate_simple_coord02.py
index d2ce74dc6cf9..11db9dfa4652 100644
--- a/doc/users/plotting/examples/annotate_simple_coord02.py
+++ b/examples/userdemo/annotate_simple_coord02.py
@@ -1,3 +1,9 @@
+"""
+=======================
+Annotate Simple Coord02
+=======================
+
+"""
import matplotlib.pyplot as plt
diff --git a/doc/users/plotting/examples/annotate_simple_coord03.py b/examples/userdemo/annotate_simple_coord03.py
similarity index 89%
rename from doc/users/plotting/examples/annotate_simple_coord03.py
rename to examples/userdemo/annotate_simple_coord03.py
index b448f7513caf..0b4875825720 100644
--- a/doc/users/plotting/examples/annotate_simple_coord03.py
+++ b/examples/userdemo/annotate_simple_coord03.py
@@ -1,3 +1,9 @@
+"""
+=======================
+Annotate Simple Coord03
+=======================
+
+"""
import matplotlib.pyplot as plt
diff --git a/doc/users/plotting/examples/annotate_text_arrow.py b/examples/userdemo/annotate_text_arrow.py
similarity index 92%
rename from doc/users/plotting/examples/annotate_text_arrow.py
rename to examples/userdemo/annotate_text_arrow.py
index 4ed10f99670e..80a75fb4b314 100644
--- a/doc/users/plotting/examples/annotate_text_arrow.py
+++ b/examples/userdemo/annotate_text_arrow.py
@@ -1,3 +1,9 @@
+"""
+===================
+Annotate Text Arrow
+===================
+
+"""
import numpy.random
import matplotlib.pyplot as plt
diff --git a/doc/mpl_toolkits/axisartist/figures/axis_direction_demo_step01.py b/examples/userdemo/axis_direction_demo_step01.py
similarity index 85%
rename from doc/mpl_toolkits/axisartist/figures/axis_direction_demo_step01.py
rename to examples/userdemo/axis_direction_demo_step01.py
index 3ff931baa5c7..f9db577e2efa 100644
--- a/doc/mpl_toolkits/axisartist/figures/axis_direction_demo_step01.py
+++ b/examples/userdemo/axis_direction_demo_step01.py
@@ -1,3 +1,9 @@
+"""
+==========================
+Axis Direction Demo Step01
+==========================
+
+"""
import matplotlib.pyplot as plt
import mpl_toolkits.axisartist as axisartist
diff --git a/doc/mpl_toolkits/axisartist/figures/axis_direction_demo_step02.py b/examples/userdemo/axis_direction_demo_step02.py
similarity index 91%
rename from doc/mpl_toolkits/axisartist/figures/axis_direction_demo_step02.py
rename to examples/userdemo/axis_direction_demo_step02.py
index bddedcea73d6..ee1f1b3bc7ed 100644
--- a/doc/mpl_toolkits/axisartist/figures/axis_direction_demo_step02.py
+++ b/examples/userdemo/axis_direction_demo_step02.py
@@ -1,3 +1,9 @@
+"""
+==========================
+Axis Direction Demo Step02
+==========================
+
+"""
import matplotlib.pyplot as plt
import mpl_toolkits.axisartist as axisartist
diff --git a/doc/mpl_toolkits/axisartist/figures/axis_direction_demo_step03.py b/examples/userdemo/axis_direction_demo_step03.py
similarity index 92%
rename from doc/mpl_toolkits/axisartist/figures/axis_direction_demo_step03.py
rename to examples/userdemo/axis_direction_demo_step03.py
index 69963d22ee69..49b65b08f0f7 100644
--- a/doc/mpl_toolkits/axisartist/figures/axis_direction_demo_step03.py
+++ b/examples/userdemo/axis_direction_demo_step03.py
@@ -1,3 +1,9 @@
+"""
+==========================
+Axis Direction Demo Step03
+==========================
+
+"""
import matplotlib.pyplot as plt
import mpl_toolkits.axisartist as axisartist
diff --git a/doc/mpl_toolkits/axisartist/figures/axis_direction_demo_step04.py b/examples/userdemo/axis_direction_demo_step04.py
similarity index 94%
rename from doc/mpl_toolkits/axisartist/figures/axis_direction_demo_step04.py
rename to examples/userdemo/axis_direction_demo_step04.py
index 2b5bf8673938..81c4f95e3789 100644
--- a/doc/mpl_toolkits/axisartist/figures/axis_direction_demo_step04.py
+++ b/examples/userdemo/axis_direction_demo_step04.py
@@ -1,3 +1,9 @@
+"""
+==========================
+Axis Direction Demo Step04
+==========================
+
+"""
import matplotlib.pyplot as plt
import mpl_toolkits.axisartist as axisartist
diff --git a/doc/users/plotting/examples/colormap_normalizations.py b/examples/userdemo/colormap_normalizations.py
similarity index 98%
rename from doc/users/plotting/examples/colormap_normalizations.py
rename to examples/userdemo/colormap_normalizations.py
index 15d38c9fc899..86aa8a2a043a 100644
--- a/doc/users/plotting/examples/colormap_normalizations.py
+++ b/examples/userdemo/colormap_normalizations.py
@@ -1,4 +1,8 @@
"""
+=======================
+Colormap Normalizations
+=======================
+
Demonstration of using norm to map colormaps onto data in non-linear ways.
"""
diff --git a/doc/users/plotting/examples/colormap_normalizations_bounds.py b/examples/userdemo/colormap_normalizations_bounds.py
similarity index 93%
rename from doc/users/plotting/examples/colormap_normalizations_bounds.py
rename to examples/userdemo/colormap_normalizations_bounds.py
index fb84e1d2efe2..fb05db5322e1 100644
--- a/doc/users/plotting/examples/colormap_normalizations_bounds.py
+++ b/examples/userdemo/colormap_normalizations_bounds.py
@@ -1,4 +1,8 @@
"""
+==============================
+Colormap Normalizations Bounds
+==============================
+
Demonstration of using norm to map colormaps onto data in non-linear ways.
"""
diff --git a/doc/users/plotting/examples/colormap_normalizations_custom.py b/examples/userdemo/colormap_normalizations_custom.py
similarity index 94%
rename from doc/users/plotting/examples/colormap_normalizations_custom.py
rename to examples/userdemo/colormap_normalizations_custom.py
index 89f6d7423e1e..06e66029a71c 100644
--- a/doc/users/plotting/examples/colormap_normalizations_custom.py
+++ b/examples/userdemo/colormap_normalizations_custom.py
@@ -1,4 +1,8 @@
"""
+==============================
+Colormap Normalizations Custom
+==============================
+
Demonstration of using norm to map colormaps onto data in non-linear ways.
"""
diff --git a/doc/users/plotting/examples/colormap_normalizations_lognorm.py b/examples/userdemo/colormap_normalizations_lognorm.py
similarity index 90%
rename from doc/users/plotting/examples/colormap_normalizations_lognorm.py
rename to examples/userdemo/colormap_normalizations_lognorm.py
index 82cd2a31bc66..262f6e75342a 100644
--- a/doc/users/plotting/examples/colormap_normalizations_lognorm.py
+++ b/examples/userdemo/colormap_normalizations_lognorm.py
@@ -1,4 +1,8 @@
"""
+===============================
+Colormap Normalizations Lognorm
+===============================
+
Demonstration of using norm to map colormaps onto data in non-linear ways.
"""
diff --git a/doc/users/plotting/examples/colormap_normalizations_power.py b/examples/userdemo/colormap_normalizations_power.py
similarity index 89%
rename from doc/users/plotting/examples/colormap_normalizations_power.py
rename to examples/userdemo/colormap_normalizations_power.py
index 2b5b737074cb..564c4f5e078c 100644
--- a/doc/users/plotting/examples/colormap_normalizations_power.py
+++ b/examples/userdemo/colormap_normalizations_power.py
@@ -1,4 +1,8 @@
"""
+=============================
+Colormap Normalizations Power
+=============================
+
Demonstration of using norm to map colormaps onto data in non-linear ways.
"""
diff --git a/doc/users/plotting/examples/colormap_normalizations_symlognorm.py b/examples/userdemo/colormap_normalizations_symlognorm.py
similarity index 91%
rename from doc/users/plotting/examples/colormap_normalizations_symlognorm.py
rename to examples/userdemo/colormap_normalizations_symlognorm.py
index 691b922946a1..98ce7f3ed1da 100644
--- a/doc/users/plotting/examples/colormap_normalizations_symlognorm.py
+++ b/examples/userdemo/colormap_normalizations_symlognorm.py
@@ -1,4 +1,8 @@
"""
+==================================
+Colormap Normalizations Symlognorm
+==================================
+
Demonstration of using norm to map colormaps onto data in non-linear ways.
"""
diff --git a/doc/users/plotting/examples/connect_simple01.py b/examples/userdemo/connect_simple01.py
similarity index 93%
rename from doc/users/plotting/examples/connect_simple01.py
rename to examples/userdemo/connect_simple01.py
index 7e251ca6bc28..c2faebf2b861 100644
--- a/doc/users/plotting/examples/connect_simple01.py
+++ b/examples/userdemo/connect_simple01.py
@@ -1,3 +1,9 @@
+"""
+================
+Connect Simple01
+================
+
+"""
from matplotlib.patches import ConnectionPatch
import matplotlib.pyplot as plt
diff --git a/doc/users/plotting/examples/connectionstyle_demo.py b/examples/userdemo/connectionstyle_demo.py
similarity index 97%
rename from doc/users/plotting/examples/connectionstyle_demo.py
rename to examples/userdemo/connectionstyle_demo.py
index 86757f2104e6..29a8055dec0e 100644
--- a/doc/users/plotting/examples/connectionstyle_demo.py
+++ b/examples/userdemo/connectionstyle_demo.py
@@ -1,3 +1,9 @@
+"""
+====================
+Connectionstyle Demo
+====================
+
+"""
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
diff --git a/doc/users/plotting/examples/custom_boxstyle01.py b/examples/userdemo/custom_boxstyle01.py
similarity index 95%
rename from doc/users/plotting/examples/custom_boxstyle01.py
rename to examples/userdemo/custom_boxstyle01.py
index f53f135d38e4..f89b8b008d43 100644
--- a/doc/users/plotting/examples/custom_boxstyle01.py
+++ b/examples/userdemo/custom_boxstyle01.py
@@ -1,3 +1,9 @@
+"""
+=================
+Custom Boxstyle01
+=================
+
+"""
from matplotlib.path import Path
def custom_box_style(x0, y0, width, height, mutation_size, mutation_aspect=1):
diff --git a/doc/users/plotting/examples/custom_boxstyle02.py b/examples/userdemo/custom_boxstyle02.py
similarity index 96%
rename from doc/users/plotting/examples/custom_boxstyle02.py
rename to examples/userdemo/custom_boxstyle02.py
index bd6616c8158c..dca79573c84f 100644
--- a/doc/users/plotting/examples/custom_boxstyle02.py
+++ b/examples/userdemo/custom_boxstyle02.py
@@ -1,3 +1,9 @@
+"""
+=================
+Custom Boxstyle02
+=================
+
+"""
from matplotlib.path import Path
from matplotlib.patches import BoxStyle
import matplotlib.pyplot as plt
diff --git a/doc/mpl_toolkits/axisartist/figures/demo_axis_direction.py b/examples/userdemo/demo_axis_direction.py
similarity index 97%
rename from doc/mpl_toolkits/axisartist/figures/demo_axis_direction.py
rename to examples/userdemo/demo_axis_direction.py
index a198b0b1959e..d021cf092066 100644
--- a/doc/mpl_toolkits/axisartist/figures/demo_axis_direction.py
+++ b/examples/userdemo/demo_axis_direction.py
@@ -1,3 +1,9 @@
+"""
+===================
+Demo Axis Direction
+===================
+
+"""
import numpy as np
diff --git a/doc/users/plotting/examples/demo_gridspec01.py b/examples/userdemo/demo_gridspec01.py
similarity index 91%
rename from doc/users/plotting/examples/demo_gridspec01.py
rename to examples/userdemo/demo_gridspec01.py
index 55c76a7f0f4d..1c48f40f3ce2 100644
--- a/doc/users/plotting/examples/demo_gridspec01.py
+++ b/examples/userdemo/demo_gridspec01.py
@@ -1,3 +1,9 @@
+"""
+===============
+Demo Gridspec01
+===============
+
+"""
import matplotlib.pyplot as plt
def make_ticklabels_invisible(fig):
diff --git a/doc/users/plotting/examples/demo_gridspec02.py b/examples/userdemo/demo_gridspec02.py
similarity index 91%
rename from doc/users/plotting/examples/demo_gridspec02.py
rename to examples/userdemo/demo_gridspec02.py
index 43a7f0899403..cdc2ebabf101 100644
--- a/doc/users/plotting/examples/demo_gridspec02.py
+++ b/examples/userdemo/demo_gridspec02.py
@@ -1,3 +1,9 @@
+"""
+===============
+Demo Gridspec02
+===============
+
+"""
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
diff --git a/doc/users/plotting/examples/demo_gridspec03.py b/examples/userdemo/demo_gridspec03.py
similarity index 93%
rename from doc/users/plotting/examples/demo_gridspec03.py
rename to examples/userdemo/demo_gridspec03.py
index da7c801566c1..dae3665d5934 100644
--- a/doc/users/plotting/examples/demo_gridspec03.py
+++ b/examples/userdemo/demo_gridspec03.py
@@ -1,3 +1,9 @@
+"""
+===============
+Demo Gridspec03
+===============
+
+"""
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
diff --git a/doc/users/plotting/examples/demo_gridspec04.py b/examples/userdemo/demo_gridspec04.py
similarity index 94%
rename from doc/users/plotting/examples/demo_gridspec04.py
rename to examples/userdemo/demo_gridspec04.py
index 75cd4899a897..1bd73c0926e4 100644
--- a/doc/users/plotting/examples/demo_gridspec04.py
+++ b/examples/userdemo/demo_gridspec04.py
@@ -1,3 +1,9 @@
+"""
+===============
+Demo Gridspec04
+===============
+
+"""
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
diff --git a/doc/users/plotting/examples/demo_gridspec05.py b/examples/userdemo/demo_gridspec05.py
similarity index 91%
rename from doc/users/plotting/examples/demo_gridspec05.py
rename to examples/userdemo/demo_gridspec05.py
index 6bc263a89331..37f724776040 100644
--- a/doc/users/plotting/examples/demo_gridspec05.py
+++ b/examples/userdemo/demo_gridspec05.py
@@ -1,3 +1,9 @@
+"""
+===============
+Demo Gridspec05
+===============
+
+"""
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
diff --git a/doc/users/plotting/examples/demo_gridspec06.py b/examples/userdemo/demo_gridspec06.py
similarity index 95%
rename from doc/users/plotting/examples/demo_gridspec06.py
rename to examples/userdemo/demo_gridspec06.py
index 32084dfa960b..5e79289e0ee9 100644
--- a/doc/users/plotting/examples/demo_gridspec06.py
+++ b/examples/userdemo/demo_gridspec06.py
@@ -1,3 +1,9 @@
+"""
+===============
+Demo Gridspec06
+===============
+
+"""
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import numpy as np
diff --git a/doc/mpl_toolkits/axisartist/figures/demo_parasite_axes.py b/examples/userdemo/demo_parasite_axes_sgskip.py
similarity index 95%
rename from doc/mpl_toolkits/axisartist/figures/demo_parasite_axes.py
rename to examples/userdemo/demo_parasite_axes_sgskip.py
index 5e465b2b32a6..88434b771942 100644
--- a/doc/mpl_toolkits/axisartist/figures/demo_parasite_axes.py
+++ b/examples/userdemo/demo_parasite_axes_sgskip.py
@@ -1,3 +1,9 @@
+"""
+==================
+Demo Parasite Axes
+==================
+
+"""
from mpl_toolkits.axisartist.parasite_axes import HostAxes, ParasiteAxes
import matplotlib.pyplot as plt
diff --git a/doc/mpl_toolkits/axisartist/figures/demo_ticklabel_alignment.py b/examples/userdemo/demo_ticklabel_alignment.py
similarity index 91%
rename from doc/mpl_toolkits/axisartist/figures/demo_ticklabel_alignment.py
rename to examples/userdemo/demo_ticklabel_alignment.py
index 78f81ad47df4..ef6b87d3fc3e 100644
--- a/doc/mpl_toolkits/axisartist/figures/demo_ticklabel_alignment.py
+++ b/examples/userdemo/demo_ticklabel_alignment.py
@@ -1,3 +1,9 @@
+"""
+========================
+Demo Ticklabel Alignment
+========================
+
+"""
import matplotlib.pyplot as plt
diff --git a/doc/mpl_toolkits/axisartist/figures/demo_ticklabel_direction.py b/examples/userdemo/demo_ticklabel_direction.py
similarity index 93%
rename from doc/mpl_toolkits/axisartist/figures/demo_ticklabel_direction.py
rename to examples/userdemo/demo_ticklabel_direction.py
index a52d353494d4..4a1aa02c021d 100644
--- a/doc/mpl_toolkits/axisartist/figures/demo_ticklabel_direction.py
+++ b/examples/userdemo/demo_ticklabel_direction.py
@@ -1,3 +1,9 @@
+"""
+========================
+Demo Ticklabel Direction
+========================
+
+"""
import matplotlib.pyplot as plt
import mpl_toolkits.axisartist.axislines as axislines
diff --git a/doc/users/plotting/examples/pgf_fonts.py b/examples/userdemo/pgf_fonts_sgskip.py
similarity index 94%
rename from doc/users/plotting/examples/pgf_fonts.py
rename to examples/userdemo/pgf_fonts_sgskip.py
index ae260b151406..178a560f10fd 100644
--- a/doc/users/plotting/examples/pgf_fonts.py
+++ b/examples/userdemo/pgf_fonts_sgskip.py
@@ -1,3 +1,9 @@
+"""
+=========
+Pgf Fonts
+=========
+
+"""
# -*- coding: utf-8 -*-
import matplotlib as mpl
diff --git a/doc/users/plotting/examples/pgf_preamble.py b/examples/userdemo/pgf_preamble_sgskip.py
similarity index 95%
rename from doc/users/plotting/examples/pgf_preamble.py
rename to examples/userdemo/pgf_preamble_sgskip.py
index f233afbd1db7..e513c33fc6d8 100644
--- a/doc/users/plotting/examples/pgf_preamble.py
+++ b/examples/userdemo/pgf_preamble_sgskip.py
@@ -1,3 +1,9 @@
+"""
+============
+Pgf Preamble
+============
+
+"""
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function,
unicode_literals)
diff --git a/doc/users/plotting/examples/pgf_texsystem.py b/examples/userdemo/pgf_texsystem_sgskip.py
similarity index 92%
rename from doc/users/plotting/examples/pgf_texsystem.py
rename to examples/userdemo/pgf_texsystem_sgskip.py
index 88231348b5e2..7dedca923b61 100644
--- a/doc/users/plotting/examples/pgf_texsystem.py
+++ b/examples/userdemo/pgf_texsystem_sgskip.py
@@ -1,3 +1,9 @@
+"""
+=============
+Pgf Texsystem
+=============
+
+"""
# -*- coding: utf-8 -*-
import matplotlib as mpl
diff --git a/doc/users/plotting/examples/simple_annotate01.py b/examples/userdemo/simple_annotate01.py
similarity index 98%
rename from doc/users/plotting/examples/simple_annotate01.py
rename to examples/userdemo/simple_annotate01.py
index eb99af25babd..6c5f3d2db197 100644
--- a/doc/users/plotting/examples/simple_annotate01.py
+++ b/examples/userdemo/simple_annotate01.py
@@ -1,3 +1,9 @@
+"""
+=================
+Simple Annotate01
+=================
+
+"""
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
diff --git a/doc/mpl_toolkits/axisartist/figures/simple_axis_direction01.py b/examples/userdemo/simple_axis_direction01.py
similarity index 84%
rename from doc/mpl_toolkits/axisartist/figures/simple_axis_direction01.py
rename to examples/userdemo/simple_axis_direction01.py
index d182d5826949..a62bd8110472 100644
--- a/doc/mpl_toolkits/axisartist/figures/simple_axis_direction01.py
+++ b/examples/userdemo/simple_axis_direction01.py
@@ -1,3 +1,9 @@
+"""
+=======================
+Simple Axis Direction01
+=======================
+
+"""
import matplotlib.pyplot as plt
import mpl_toolkits.axisartist as axisartist
diff --git a/doc/mpl_toolkits/axisartist/figures/simple_axis_direction03.py b/examples/userdemo/simple_axis_direction03.py
similarity index 88%
rename from doc/mpl_toolkits/axisartist/figures/simple_axis_direction03.py
rename to examples/userdemo/simple_axis_direction03.py
index 0cffb9ffe53c..21c3f8149914 100644
--- a/doc/mpl_toolkits/axisartist/figures/simple_axis_direction03.py
+++ b/examples/userdemo/simple_axis_direction03.py
@@ -1,3 +1,9 @@
+"""
+=======================
+Simple Axis Direction03
+=======================
+
+"""
import matplotlib.pyplot as plt
import mpl_toolkits.axisartist as axisartist
diff --git a/doc/mpl_toolkits/axisartist/figures/simple_axis_pad.py b/examples/userdemo/simple_axis_pad.py
similarity index 98%
rename from doc/mpl_toolkits/axisartist/figures/simple_axis_pad.py
rename to examples/userdemo/simple_axis_pad.py
index bfbfb00b4343..c6643ed5cb94 100644
--- a/doc/mpl_toolkits/axisartist/figures/simple_axis_pad.py
+++ b/examples/userdemo/simple_axis_pad.py
@@ -1,3 +1,9 @@
+"""
+===============
+Simple Axis Pad
+===============
+
+"""
import numpy as np
diff --git a/doc/mpl_toolkits/axisartist/figures/simple_axisartist1.py b/examples/userdemo/simple_axisartist1.py
similarity index 89%
rename from doc/mpl_toolkits/axisartist/figures/simple_axisartist1.py
rename to examples/userdemo/simple_axisartist1.py
index d9a8a69094e0..411c45c9f605 100644
--- a/doc/mpl_toolkits/axisartist/figures/simple_axisartist1.py
+++ b/examples/userdemo/simple_axisartist1.py
@@ -1,3 +1,9 @@
+"""
+==================
+Simple Axisartist1
+==================
+
+"""
import matplotlib.pyplot as plt
import mpl_toolkits.axisartist as AA
diff --git a/doc/mpl_toolkits/axisartist/figures/simple_axisline.py b/examples/userdemo/simple_axisline.py
similarity index 94%
rename from doc/mpl_toolkits/axisartist/figures/simple_axisline.py
rename to examples/userdemo/simple_axisline.py
index 6c0d585c8ee3..6949d0b309b4 100644
--- a/doc/mpl_toolkits/axisartist/figures/simple_axisline.py
+++ b/examples/userdemo/simple_axisline.py
@@ -1,3 +1,9 @@
+"""
+===============
+Simple Axisline
+===============
+
+"""
import matplotlib.pyplot as plt
from mpl_toolkits.axisartist.axislines import SubplotZero
diff --git a/doc/mpl_toolkits/axisartist/figures/simple_axisline2.py b/examples/userdemo/simple_axisline2.py
similarity index 91%
rename from doc/mpl_toolkits/axisartist/figures/simple_axisline2.py
rename to examples/userdemo/simple_axisline2.py
index 47534c2830cd..eb77f4e3e22c 100644
--- a/doc/mpl_toolkits/axisartist/figures/simple_axisline2.py
+++ b/examples/userdemo/simple_axisline2.py
@@ -1,3 +1,9 @@
+"""
+================
+Simple Axisline2
+================
+
+"""
import matplotlib.pyplot as plt
from mpl_toolkits.axisartist.axislines import SubplotZero
import numpy as np
diff --git a/doc/mpl_toolkits/axisartist/figures/simple_axisline3.py b/examples/userdemo/simple_axisline3.py
similarity index 80%
rename from doc/mpl_toolkits/axisartist/figures/simple_axisline3.py
rename to examples/userdemo/simple_axisline3.py
index 8256b5669ee4..58e2e043f57c 100644
--- a/doc/mpl_toolkits/axisartist/figures/simple_axisline3.py
+++ b/examples/userdemo/simple_axisline3.py
@@ -1,3 +1,9 @@
+"""
+================
+Simple Axisline3
+================
+
+"""
import matplotlib.pyplot as plt
from mpl_toolkits.axisartist.axislines import Subplot
diff --git a/doc/users/plotting/examples/simple_legend01.py b/examples/userdemo/simple_legend01.py
similarity index 90%
rename from doc/users/plotting/examples/simple_legend01.py
rename to examples/userdemo/simple_legend01.py
index 8e0ede331670..4dc590d14e54 100644
--- a/doc/users/plotting/examples/simple_legend01.py
+++ b/examples/userdemo/simple_legend01.py
@@ -1,3 +1,9 @@
+"""
+===============
+Simple Legend01
+===============
+
+"""
import matplotlib.pyplot as plt
diff --git a/doc/users/plotting/examples/simple_legend02.py b/examples/userdemo/simple_legend02.py
similarity index 88%
rename from doc/users/plotting/examples/simple_legend02.py
rename to examples/userdemo/simple_legend02.py
index dabd2f072e72..d6c3a08d6c42 100644
--- a/doc/users/plotting/examples/simple_legend02.py
+++ b/examples/userdemo/simple_legend02.py
@@ -1,3 +1,9 @@
+"""
+===============
+Simple Legend02
+===============
+
+"""
import matplotlib.pyplot as plt
line1, = plt.plot([1,2,3], label="Line 1", linestyle='--')
diff --git a/examples/widgets/polygon_selector_demo.py b/examples/widgets/polygon_selector_demo.py
index e692ccfa4935..7126d2c78482 100644
--- a/examples/widgets/polygon_selector_demo.py
+++ b/examples/widgets/polygon_selector_demo.py
@@ -1,4 +1,6 @@
"""
+.. _widgets-polygon_selector_demo:
+
=====================
Polygon Selector Demo
=====================
diff --git a/examples/widgets/span_selector.py b/examples/widgets/span_selector.py
index 140b45c001fd..b25d4497ac2f 100644
--- a/examples/widgets/span_selector.py
+++ b/examples/widgets/span_selector.py
@@ -1,4 +1,6 @@
"""
+.. _widgets-span_selector:
+
=============
Span Selector
=============
diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py
index 7c219f77a07f..ee9ff50c3634 100644
--- a/lib/matplotlib/axes/_axes.py
+++ b/lib/matplotlib/axes/_axes.py
@@ -831,10 +831,6 @@ def axhspan(self, ymin, ymax, xmin=0, xmax=1, **kwargs):
--------
axvspan : Add a vertical span (rectangle) across the axes.
- Examples
- --------
- .. plot:: mpl_examples/pylab_examples/axhspan_demo.py
-
"""
trans = self.get_yaxis_transform(which='grid')
@@ -951,10 +947,6 @@ def hlines(self, y, xmin, xmax, colors='k', linestyles='solid',
--------
vlines : vertical lines
- Examples
- --------
- .. plot:: mpl_examples/pylab_examples/vline_hline_demo.py
-
"""
# We do the conversion first since not all unitized data is uniform
@@ -1033,10 +1025,6 @@ def vlines(self, x, ymin, ymax, colors='k', linestyles='solid',
--------
hlines : horizontal lines
- Examples
- --------
- .. plot:: mpl_examples/pylab_examples/vline_hline_demo.py
-
"""
self._process_unit_info(xdata=x, ydata=[ymin, ymax], kwargs=kwargs)
@@ -1135,10 +1123,6 @@ def eventplot(self, positions, orientation='horizontal', lineoffsets=1,
kwargs are :class:`~matplotlib.collections.LineCollection` properties:
%(LineCollection)s
-
- **Example:**
-
- .. plot:: mpl_examples/pylab_examples/eventplot_demo.py
"""
self._process_unit_info(xdata=positions,
ydata=[lineoffsets, linelengths],
@@ -1517,10 +1501,6 @@ def loglog(self, *args, **kwargs):
%(Line2D)s
- **Example:**
-
- .. plot:: mpl_examples/pylab_examples/log_demo.py
-
"""
if not self._hold:
self.cla()
@@ -1702,15 +1682,6 @@ def acorr(self, x, **kwargs):
-----
The cross correlation is performed with :func:`numpy.correlate` with
`mode` = 2.
-
- Examples
- --------
-
- `~matplotlib.pyplot.xcorr` is top graph, and
- `~matplotlib.pyplot.acorr` is bottom graph.
-
- .. plot:: mpl_examples/pylab_examples/xcorr_demo.py
-
"""
if "hold" in kwargs:
warnings.warn("the 'hold' kwarg is deprecated", mplDeprecation)
@@ -1957,13 +1928,6 @@ def bar(self, left, height, width=0.8, bottom=None, **kwargs):
See also
--------
barh: Plot a horizontal bar plot.
-
- Examples
- --------
-
- **Example:** A stacked bar chart.
-
- .. plot:: mpl_examples/pylab_examples/bar_stacked.py
"""
kwargs = cbook.normalize_kwargs(kwargs, mpatches._patch_alias_map)
if not self._hold:
@@ -2315,10 +2279,6 @@ def broken_barh(self, xranges, yrange, **kwargs):
or a sequence of arguments for the various bars, i.e.,::
facecolors = ('black', 'red', 'green')
-
- **Example:**
-
- .. plot:: mpl_examples/pylab_examples/broken_barh.py
"""
# process the unit information
if len(xranges):
@@ -2366,10 +2326,6 @@ def stem(self, *args, **kwargs):
`document `_
for details.
-
- **Example:**
-
- .. plot:: mpl_examples/pylab_examples/stem_plot.py
"""
remember_hold = self._hold
if not self._hold:
@@ -2564,10 +2520,6 @@ def pie(self, x, explode=None, labels=None, colors=None,
The pie chart will probably look best if the figure and axes are
square, or the Axes aspect is equal.
- Examples
- --------
- .. plot:: mpl_examples/pie_and_polar_charts/pie_features.py
-
"""
@@ -2796,10 +2748,6 @@ def errorbar(self, x, y, yerr=None, xerr=None,
%(Line2D)s
- Examples
- --------
- .. plot:: gallery/statistics/errorbar.py
-
"""
kwargs = cbook.normalize_kwargs(kwargs, _alias_map)
# anything that comes in as 'None', drop so the default thing
@@ -3268,10 +3216,6 @@ def boxplot(self, x, notch=None, sym=None, vert=None, whis=None,
- ``means``: points or lines representing the means.
- Examples
- --------
- .. plot:: gallery/statistics/boxplot.py
-
"""
# If defined in matplotlibrc, apply the value from rc file
@@ -3914,10 +3858,6 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
flattened. The exception is `c`, which will be flattened only if its
size matches the size of `x` and `y`.
- Examples
- --------
- .. plot:: gallery/shapes_and_collections/scatter.py
-
"""
if not self._hold:
@@ -4207,10 +4147,6 @@ def hexbin(self, x, y, C=None, gridsize=100, bins=None,
bar and vertical bar (both PolyCollections) will be attached
to the return collection as attributes *hbar* and *vbar*.
- Examples
- --------
- .. plot:: mpl_examples/pylab_examples/hexbin_demo.py
-
Notes
--------
The standard descriptions of all the
@@ -4573,12 +4509,6 @@ def arrow(self, x, y, dx, dy, **kwargs):
ax.annotate("", xy=(0.5, 0.5), xytext=(0, 0),
arrowprops=dict(arrowstyle="->"))
-
- Examples
- --------
-
- .. plot:: mpl_examples/pylab_examples/arrow_demo.py
-
"""
# Strip away units for the underlying patch since units
# do not make sense to most patch-like code
@@ -4648,10 +4578,6 @@ def streamplot(self, x, y, u, v, density=1, linewidth=None, color=None,
def barbs(self, *args, **kw):
"""
%(barbs_doc)s
-
- **Example:**
-
- .. plot:: mpl_examples/pylab_examples/barb_demo.py
"""
if not self._hold:
self.cla()
@@ -4697,10 +4623,6 @@ def fill(self, *args, **kwargs):
If you would like to fill below a curve, e.g., shade a region
between 0 and *y* along *x*, use :meth:`fill_between`
- Examples
- --------
- .. plot:: gallery/lines_bars_and_markers/fill.py
-
"""
if not self._hold:
@@ -4765,11 +4687,6 @@ def fill_between(self, x, y1, y2=0, where=None, interpolate=False,
%(PolyCollection)s
- Examples
- --------
-
- .. plot:: mpl_examples/pylab_examples/fill_between_demo.py
-
See Also
--------
@@ -4932,11 +4849,6 @@ def fill_betweenx(self, y, x1, x2=0, where=None,
%(PolyCollection)s
- Examples
- --------
-
- .. plot:: mpl_examples/pylab_examples/fill_betweenx_demo.py
-
See Also
--------
@@ -5159,11 +5071,6 @@ def imshow(self, X, cmap=None, norm=None, aspect=None,
coordinates. In other words: the origin will coincide with the center
of pixel (0, 0).
- Examples
- --------
-
- .. plot:: mpl_examples/pylab_examples/image_demo.py
-
"""
if not self._hold:
@@ -6100,10 +6007,6 @@ def hist(self, x, bins=None, range=None, normed=False, weights=None,
inherited that error. It is now corrected within MPL when using
earlier numpy versions.
- Examples
- --------
- .. plot:: gallery/statistics/histogram_features.py
-
"""
# Avoid shadowing the builtin.
bin_range = range
@@ -6480,10 +6383,6 @@ def hist2d(self, x, y, bins=10, range=None, normed=False, weights=None,
the *norm* keyword argument. Likewise, power-law normalization
(similar in effect to gamma correction) can be accomplished with
:class:`colors.PowerNorm`.
-
- Examples
- --------
- .. plot:: gallery/statistics/hist.py
"""
h, xedges, yedges = np.histogram2d(x, y, bins=bins, range=range,
@@ -6577,10 +6476,6 @@ def psd(self, x, NFFT=None, Fs=None, Fc=None, detrend=None,
Bendat & Piersol -- Random Data: Analysis and Measurement Procedures,
John Wiley & Sons (1986)
- Examples
- --------
- .. plot:: mpl_examples/pylab_examples/psd_demo.py
-
See Also
--------
:func:`specgram`
@@ -6708,10 +6603,6 @@ def csd(self, x, y, NFFT=None, Fs=None, Fc=None, detrend=None,
Bendat & Piersol -- Random Data: Analysis and Measurement Procedures,
John Wiley & Sons (1986)
- Examples
- --------
- .. plot:: mpl_examples/pylab_examples/csd_demo.py
-
See Also
--------
:func:`psd`
@@ -6801,10 +6692,6 @@ def magnitude_spectrum(self, x, Fs=None, Fc=None, window=None,
line : a :class:`~matplotlib.lines.Line2D` instance
The line created by this function
- Examples
- --------
- .. plot:: mpl_examples/pylab_examples/spectrum_demo.py
-
See Also
--------
:func:`psd`
@@ -6898,10 +6785,6 @@ def angle_spectrum(self, x, Fs=None, Fc=None, window=None,
line : a :class:`~matplotlib.lines.Line2D` instance
The line created by this function
- Examples
- --------
- .. plot:: mpl_examples/pylab_examples/spectrum_demo.py
-
See Also
--------
:func:`magnitude_spectrum`
@@ -6980,10 +6863,6 @@ def phase_spectrum(self, x, Fs=None, Fc=None, window=None,
line : a :class:`~matplotlib.lines.Line2D` instance
The line created by this function
- Examples
- --------
- .. plot:: mpl_examples/pylab_examples/spectrum_demo.py
-
See Also
--------
:func:`magnitude_spectrum`
@@ -7061,10 +6940,6 @@ def cohere(self, x, y, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
----------
Bendat & Piersol -- Random Data: Analysis and Measurement Procedures,
John Wiley & Sons (1986)
-
- Examples
- --------
- .. plot:: gallery/lines_bars_and_markers/cohere.py
"""
if not self._hold:
self.cla()
@@ -7173,10 +7048,6 @@ def specgram(self, x, NFFT=None, Fs=None, Fc=None, detrend=None,
im : instance of class :class:`~matplotlib.image.AxesImage`
The image created by imshow containing the spectrogram
- Examples
- --------
- .. plot:: mpl_examples/pylab_examples/specgram_demo.py
-
See Also
--------
:func:`psd`
@@ -7384,10 +7255,6 @@ def matshow(self, Z, **kwargs):
--------
imshow : plot an image
- Examples
- --------
- .. plot:: mpl_examples/pylab_examples/matshow.py
-
"""
Z = np.asanyarray(Z)
nr, nc = Z.shape
diff --git a/lib/matplotlib/collections.py b/lib/matplotlib/collections.py
index 938b08aefa3c..d9aaacf57eaa 100644
--- a/lib/matplotlib/collections.py
+++ b/lib/matplotlib/collections.py
@@ -1302,10 +1302,6 @@ def __init__(self,
:attr:`~matplotlib.cm.ScalarMappable._A` is not None (i.e., a call to
:meth:`~matplotlib.cm.ScalarMappable.set_array` has been made), at
draw time a call to scalar mappable will be made to set the colors.
-
- **Example:**
-
- .. plot:: mpl_examples/pylab_examples/eventcollection_demo.py
"""
segment = (lineoffset + linelength / 2.,
diff --git a/lib/matplotlib/contour.py b/lib/matplotlib/contour.py
index c3c10a293877..01fbb1e24b37 100644
--- a/lib/matplotlib/contour.py
+++ b/lib/matplotlib/contour.py
@@ -133,8 +133,6 @@ def clabel(self, *args, **kwargs):
matplotlib.Text) is used to create labels. ClabelText
recalculates rotation angles of texts during the drawing time,
therefore this can be used if aspect of the axes changes.
-
- .. plot:: mpl_examples/pylab_examples/contour_demo.py
"""
"""
@@ -794,10 +792,6 @@ def __init__(self, ax, *args, **kwargs):
Keyword arguments are as described in
:attr:`matplotlib.contour.QuadContourSet.contour_doc`.
-
- **Examples:**
-
- .. plot:: mpl_examples/misc/contour_manual.py
"""
self.ax = ax
self.levels = kwargs.get('levels', None)
@@ -1822,12 +1816,4 @@ def _initialize_x_y(self, z):
There is one exception: if the lowest boundary coincides with
the minimum value of the *z* array, then that minimum value
will be included in the lowest interval.
-
- **Examples:**
-
- .. plot:: mpl_examples/pylab_examples/contour_demo.py
-
- .. plot:: mpl_examples/pylab_examples/contourf_demo.py
-
- .. plot:: mpl_examples/pylab_examples/contour_corner_mask.py
"""
diff --git a/lib/matplotlib/dates.py b/lib/matplotlib/dates.py
index b7f1ad8fe0f6..0d54c69f90e0 100644
--- a/lib/matplotlib/dates.py
+++ b/lib/matplotlib/dates.py
@@ -89,7 +89,7 @@
:class:`dateutil.rrule` (`dateutil
`_) which allow almost
arbitrary date tick specifications. See `rrule example
- <../examples/pylab_examples/date_demo_rrule.html>`_.
+ <../gallery/pylab_examples/date_demo_rrule.html>`_.
* :class:`AutoDateLocator`: On autoscale, this class picks the best
:class:`MultipleDateLocator` to set the view limits and the tick
diff --git a/lib/matplotlib/figure.py b/lib/matplotlib/figure.py
index 3031730c6754..290090bb9999 100644
--- a/lib/matplotlib/figure.py
+++ b/lib/matplotlib/figure.py
@@ -660,9 +660,6 @@ def figimage(self, X,
An :class:`matplotlib.image.FigureImage` instance is returned.
- .. plot:: mpl_examples/pylab_examples/figimage_demo.py
-
-
Additional kwargs are Artist kwargs passed on to
:class:`~matplotlib.image.FigureImage`
"""
@@ -1412,10 +1409,6 @@ def legend(self, *args, **kwargs):
-----
Not all kinds of artist are supported by the legend command.
See :ref:`plotting-guide-legend` for details.
-
- Examples
- --------
- .. plot:: mpl_examples/pylab_examples/figlegend_demo.py
"""
# If no arguments given, collect up all the artists on the figure
diff --git a/lib/matplotlib/patches.py b/lib/matplotlib/patches.py
index 66518deacb2a..7204df850c30 100644
--- a/lib/matplotlib/patches.py
+++ b/lib/matplotlib/patches.py
@@ -1947,8 +1947,6 @@ class BoxStyle(_Style):
mutation (by which I mean the transformation of the rectangle to
the fancy box). *mutation_aspect* determines the aspect-ratio of
the mutation.
-
- .. plot:: mpl_examples/pylab_examples/fancybox_demo2.py
"""
_style_list = {}
@@ -3170,8 +3168,6 @@ class ArrowStyle(_Style):
stroked. This is meant to be used to correct the location of the
head so that it does not overshoot the destination point, but not all
classes support it.
-
- .. plot:: mpl_examples/pylab_examples/fancyarrow_demo.py
"""
_style_list = {}
diff --git a/lib/matplotlib/quiver.py b/lib/matplotlib/quiver.py
index b11e9d5fa114..aed77ee72b78 100644
--- a/lib/matplotlib/quiver.py
+++ b/lib/matplotlib/quiver.py
@@ -165,10 +165,6 @@
%(PolyCollection)s
-Examples
---------
-.. plot:: mpl_examples/pylab_examples/quiver_simple_demo.py
-
See Also
--------
quiverkey : Add a key to a quiver plot
diff --git a/lib/matplotlib/tri/tricontour.py b/lib/matplotlib/tri/tricontour.py
index a528e13386b0..c1727b7fbaa9 100644
--- a/lib/matplotlib/tri/tricontour.py
+++ b/lib/matplotlib/tri/tricontour.py
@@ -264,10 +264,6 @@ def _contour_args(self, args, kwargs):
There is one exception: if the lowest boundary coincides with
the minimum value of the *z* array, then that minimum value
will be included in the lowest interval.
-
- **Examples:**
-
- .. plot:: mpl_examples/pylab_examples/tricontour_demo.py
"""
diff --git a/lib/matplotlib/tri/triinterpolate.py b/lib/matplotlib/tri/triinterpolate.py
index fda01095333e..b98c10ef4ca3 100644
--- a/lib/matplotlib/tri/triinterpolate.py
+++ b/lib/matplotlib/tri/triinterpolate.py
@@ -438,16 +438,7 @@ def __call__(self, x, y):
def gradient(self, x, y):
return self._interpolate_multikeys(x, y, tri_index=None,
return_keys=('dzdx', 'dzdy'))
- gradient.__doc__ = TriInterpolator.docstringgradient + """
-
- Examples
- --------
- An example of effective application is shown below (plot of the
- direction of the vector field derivated from a known potential field):
-
- .. plot:: mpl_examples/pylab_examples/trigradient_demo.py
-
- """
+ gradient.__doc__ = TriInterpolator.docstringgradient
def _interpolate_single_key(self, return_key, tri_index, x, y):
tris_pts = self._tris_pts[tri_index]
diff --git a/lib/matplotlib/tri/tripcolor.py b/lib/matplotlib/tri/tripcolor.py
index 73992fe786aa..ce48e5b39b39 100644
--- a/lib/matplotlib/tri/tripcolor.py
+++ b/lib/matplotlib/tri/tripcolor.py
@@ -48,10 +48,6 @@ def tripcolor(ax, *args, **kwargs):
The remaining kwargs are the same as for
:meth:`~matplotlib.axes.Axes.pcolor`.
-
- **Example:**
-
- .. plot:: mpl_examples/pylab_examples/tripcolor_demo.py
"""
if not ax._hold:
ax.cla()
diff --git a/lib/matplotlib/tri/triplot.py b/lib/matplotlib/tri/triplot.py
index fe0a064d8a71..b22d77b71e6c 100644
--- a/lib/matplotlib/tri/triplot.py
+++ b/lib/matplotlib/tri/triplot.py
@@ -39,10 +39,6 @@ def triplot(ax, *args, **kwargs):
- the lines plotted for triangles edges
- the markers plotted for triangles nodes
-
- **Example:**
-
- .. plot:: mpl_examples/pylab_examples/triplot_demo.py
"""
import matplotlib.axes
diff --git a/lib/matplotlib/tri/trirefine.py b/lib/matplotlib/tri/trirefine.py
index 62a9f804ac1c..0a3c5ae40fbf 100644
--- a/lib/matplotlib/tri/trirefine.py
+++ b/lib/matplotlib/tri/trirefine.py
@@ -164,15 +164,6 @@ def refine_field(self, z, triinterpolator=None, subdiv=3):
The returned refined triangulation
refi_z : 1d array of length: *refi_tri* node count.
The returned interpolated field (at *refi_tri* nodes)
-
- Examples
- --------
- The main application of this method is to plot high-quality
- iso-contours on a coarse triangular grid (e.g., triangulation built
- from relatively sparse test data):
-
- .. plot:: mpl_examples/pylab_examples/tricontour_smooth_user.py
-
"""
if triinterpolator is None:
interp = matplotlib.tri.CubicTriInterpolator(
diff --git a/lib/matplotlib/tri/tritools.py b/lib/matplotlib/tri/tritools.py
index fa1ef54db5b3..04bbda0021e4 100644
--- a/lib/matplotlib/tri/tritools.py
+++ b/lib/matplotlib/tri/tritools.py
@@ -171,13 +171,6 @@ def get_flat_tri_mask(self, min_circle_ratio=0.01, rescale=True):
triangulation would contain no more unmasked border triangles
with a circle ratio below *min_circle_ratio*, thus improving the
mesh quality for subsequent plots or interpolation.
-
- Examples
- --------
- Please refer to the following illustrating example:
-
- .. plot:: mpl_examples/pylab_examples/tricontour_smooth_delaunay.py
-
"""
# Recursively computes the mask_current_borders, true if a triangle is
# at the border of the mesh OR touching the border through a chain of
diff --git a/lib/matplotlib/widgets.py b/lib/matplotlib/widgets.py
index d1d01fc8083e..3c4a829a37b7 100644
--- a/lib/matplotlib/widgets.py
+++ b/lib/matplotlib/widgets.py
@@ -1228,8 +1228,6 @@ def __init__(self, ax, horizOn=True, vertOn=True, useblit=False,
Add a cursor to *ax*. If ``useblit=True``, use the backend-
dependent blitting features for faster updates (GTKAgg
only for now). *lineprops* is a dictionary of line properties.
-
- .. plot :: mpl_examples/widgets/cursor.py
"""
# TODO: Is the GTKAgg limitation still true?
AxesWidget.__init__(self, ax)
diff --git a/lib/mpl_toolkits/mplot3d/axes3d.py b/lib/mpl_toolkits/mplot3d/axes3d.py
index a4069eb80ad6..3fec49ef00be 100644
--- a/lib/mpl_toolkits/mplot3d/axes3d.py
+++ b/lib/mpl_toolkits/mplot3d/axes3d.py
@@ -2471,11 +2471,6 @@ def bar3d(self, x, y, z, dx, dy, dz, color=None,
collection : Poly3DCollection
A collection of three dimensional polygons representing
the bars.
-
- Examples
- --------
- .. plot:: mpl_examples/mplot3d/3d_bars.py
-
"""
had_data = self.has_data()