diff --git a/.flake8 b/.flake8 index 431fc8f51a3c..d726b4443ca4 100644 --- a/.flake8 +++ b/.flake8 @@ -253,7 +253,7 @@ per-file-ignores = examples/subplots_axes_and_figures/axes_zoom_effect.py: E402 examples/subplots_axes_and_figures/custom_figure_class.py: E402 examples/subplots_axes_and_figures/demo_constrained_layout.py: E402 - examples/subplots_axes_and_figures/demo_tight_layout.py: E402 + examples/subplots_axes_and_figures/demo_tight_layout.py: E402, E501 examples/subplots_axes_and_figures/figure_size_units.py: E402 examples/subplots_axes_and_figures/secondary_axis.py: E402 examples/subplots_axes_and_figures/two_scales.py: E402 diff --git a/examples/axes_grid1/scatter_hist_locatable_axes.py b/examples/axes_grid1/scatter_hist_locatable_axes.py index 60dec95d71b9..30111e876d1c 100644 --- a/examples/axes_grid1/scatter_hist_locatable_axes.py +++ b/examples/axes_grid1/scatter_hist_locatable_axes.py @@ -65,17 +65,12 @@ ############################################################################# # -# ------------ +## .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions, methods and classes is shown -# in this example: - -import matplotlib -import mpl_toolkits -mpl_toolkits.axes_grid1.axes_divider.make_axes_locatable -matplotlib.axes.Axes.set_aspect -matplotlib.axes.Axes.scatter -matplotlib.axes.Axes.hist +# - `mpl_toolkits.axes_grid1.axes_divider.make_axes_locatable` +# - `matplotlib.axes.Axes.set_aspect` +# - `matplotlib.axes.Axes.scatter` +# - `matplotlib.axes.Axes.hist` diff --git a/examples/images_contours_and_fields/affine_image.py b/examples/images_contours_and_fields/affine_image.py index 8a3a78e2fee6..4b131d95588e 100644 --- a/examples/images_contours_and_fields/affine_image.py +++ b/examples/images_contours_and_fields/affine_image.py @@ -66,15 +66,10 @@ def do_plot(ax, Z, transform): ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions, methods and classes is shown -# in this example: - -import matplotlib -matplotlib.axes.Axes.imshow -matplotlib.pyplot.imshow -matplotlib.transforms.Affine2D +# - `matplotlib.axes.Axes.imshow` / `matplotlib.pyplot.imshow` +# - `matplotlib.transforms.Affine2D` diff --git a/examples/images_contours_and_fields/barb_demo.py b/examples/images_contours_and_fields/barb_demo.py index 04bf151e6814..45a099899c1a 100644 --- a/examples/images_contours_and_fields/barb_demo.py +++ b/examples/images_contours_and_fields/barb_demo.py @@ -56,14 +56,9 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions, methods and classes is shown -# in this example: - -import matplotlib -matplotlib.axes.Axes.barbs -matplotlib.pyplot.barbs +# - `matplotlib.axes.Axes.barbs` / `matplotlib.pyplot.barbs` diff --git a/examples/images_contours_and_fields/barcode_demo.py b/examples/images_contours_and_fields/barcode_demo.py index de00656cf67e..20fec531c097 100644 --- a/examples/images_contours_and_fields/barcode_demo.py +++ b/examples/images_contours_and_fields/barcode_demo.py @@ -39,15 +39,10 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions, methods and classes is shown -# in this example: - -import matplotlib -matplotlib.axes.Axes.imshow -matplotlib.pyplot.imshow -matplotlib.figure.Figure.add_axes +# - `matplotlib.axes.Axes.imshow` / `matplotlib.pyplot.imshow` +# - `matplotlib.figure.Figure.add_axes` diff --git a/examples/images_contours_and_fields/contour_corner_mask.py b/examples/images_contours_and_fields/contour_corner_mask.py index 0482945d552b..280231acb950 100644 --- a/examples/images_contours_and_fields/contour_corner_mask.py +++ b/examples/images_contours_and_fields/contour_corner_mask.py @@ -39,16 +39,10 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions and methods is shown -# in this example: - -import matplotlib -matplotlib.axes.Axes.contour -matplotlib.pyplot.contour -matplotlib.axes.Axes.contourf -matplotlib.pyplot.contourf +# - `matplotlib.axes.Axes.contour` / `matplotlib.pyplot.contour` +# - `matplotlib.axes.Axes.contourf` / `matplotlib.pyplot.contourf` diff --git a/examples/images_contours_and_fields/contour_demo.py b/examples/images_contours_and_fields/contour_demo.py index 2c9881c83fe1..4c98d4c8bc4c 100644 --- a/examples/images_contours_and_fields/contour_demo.py +++ b/examples/images_contours_and_fields/contour_demo.py @@ -10,7 +10,6 @@ `. """ -import matplotlib import numpy as np import matplotlib.cm as cm import matplotlib.pyplot as plt @@ -57,7 +56,7 @@ ############################################################################### # You can set negative contours to be solid instead of dashed: -matplotlib.rcParams['contour.negative_linestyle'] = 'solid' +plt.rcParams['contour.negative_linestyle'] = 'solid' fig, ax = plt.subplots() CS = ax.contour(X, Y, Z, 6, colors='k') # Negative contours default to dashed. ax.clabel(CS, fontsize=9, inline=True) @@ -111,20 +110,13 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions and methods is shown -# in this example: - -import matplotlib -matplotlib.axes.Axes.contour -matplotlib.pyplot.contour -matplotlib.figure.Figure.colorbar -matplotlib.pyplot.colorbar -matplotlib.axes.Axes.clabel -matplotlib.pyplot.clabel -matplotlib.axes.Axes.set_position -matplotlib.axes.Axes.get_position +# - `matplotlib.axes.Axes.contour` / `matplotlib.pyplot.contour` +# - `matplotlib.figure.Figure.colorbar` / `matplotlib.pyplot.colorbar` +# - `matplotlib.axes.Axes.clabel` / `matplotlib.pyplot.clabel` +# - `matplotlib.axes.Axes.get_position` +# - `matplotlib.axes.Axes.set_position` diff --git a/examples/images_contours_and_fields/contour_image.py b/examples/images_contours_and_fields/contour_image.py index cca7ea6da6a4..444d4df4a78f 100644 --- a/examples/images_contours_and_fields/contour_image.py +++ b/examples/images_contours_and_fields/contour_image.py @@ -97,19 +97,12 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions, methods and classes is shown -# in this example: - -import matplotlib -matplotlib.axes.Axes.contour -matplotlib.pyplot.contour -matplotlib.axes.Axes.imshow -matplotlib.pyplot.imshow -matplotlib.figure.Figure.colorbar -matplotlib.pyplot.colorbar -matplotlib.colors.Normalize +# - `matplotlib.axes.Axes.contour` / `matplotlib.pyplot.contour` +# - `matplotlib.axes.Axes.imshow` / `matplotlib.pyplot.imshow` +# - `matplotlib.figure.Figure.colorbar` / `matplotlib.pyplot.colorbar` +# - `matplotlib.colors.Normalize` diff --git a/examples/images_contours_and_fields/contour_label_demo.py b/examples/images_contours_and_fields/contour_label_demo.py index 733a17be48b9..0ea3d3694ca1 100644 --- a/examples/images_contours_and_fields/contour_label_demo.py +++ b/examples/images_contours_and_fields/contour_label_demo.py @@ -10,7 +10,6 @@ `. """ -import matplotlib import numpy as np import matplotlib.ticker as ticker import matplotlib.pyplot as plt @@ -76,17 +75,12 @@ def fmt(x): ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions, methods and classes is shown -# in this example: - -matplotlib.axes.Axes.contour -matplotlib.pyplot.contour -matplotlib.axes.Axes.clabel -matplotlib.pyplot.clabel -matplotlib.ticker.LogFormatterMathtext -matplotlib.ticker.TickHelper.create_dummy_axis +# - `matplotlib.axes.Axes.contour` / `matplotlib.pyplot.contour` +# - `matplotlib.axes.Axes.clabel` / `matplotlib.pyplot.clabel` +# - `matplotlib.ticker.LogFormatterMathtext` +# - `matplotlib.ticker.TickHelper.create_dummy_axis` diff --git a/examples/images_contours_and_fields/contourf_demo.py b/examples/images_contours_and_fields/contourf_demo.py index 68e540e34e9b..28b8ed2f33d6 100644 --- a/examples/images_contours_and_fields/contourf_demo.py +++ b/examples/images_contours_and_fields/contourf_demo.py @@ -106,24 +106,16 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions, methods and classes is shown -# in this example: - -import matplotlib -matplotlib.axes.Axes.contour -matplotlib.pyplot.contour -matplotlib.axes.Axes.contourf -matplotlib.pyplot.contourf -matplotlib.axes.Axes.clabel -matplotlib.pyplot.clabel -matplotlib.figure.Figure.colorbar -matplotlib.pyplot.colorbar -matplotlib.colors.Colormap -matplotlib.colors.Colormap.set_bad -matplotlib.colors.Colormap.set_under -matplotlib.colors.Colormap.set_over +# - `matplotlib.axes.Axes.contour` / `matplotlib.pyplot.contour` +# - `matplotlib.axes.Axes.contourf` / `matplotlib.pyplot.contourf` +# - `matplotlib.axes.Axes.clabel` / `matplotlib.pyplot.clabel` +# - `matplotlib.figure.Figure.colorbar` / `matplotlib.pyplot.colorbar` +# - `matplotlib.colors.Colormap` +# - `matplotlib.colors.Colormap.set_bad` +# - `matplotlib.colors.Colormap.set_under` +# - `matplotlib.colors.Colormap.set_over` diff --git a/examples/images_contours_and_fields/contourf_hatching.py b/examples/images_contours_and_fields/contourf_hatching.py index 1711556db70a..10b4698eadc9 100644 --- a/examples/images_contours_and_fields/contourf_hatching.py +++ b/examples/images_contours_and_fields/contourf_hatching.py @@ -42,22 +42,14 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions, methods and classes is shown -# in this example: - -import matplotlib -matplotlib.axes.Axes.contour -matplotlib.pyplot.contour -matplotlib.axes.Axes.contourf -matplotlib.pyplot.contourf -matplotlib.figure.Figure.colorbar -matplotlib.pyplot.colorbar -matplotlib.axes.Axes.legend -matplotlib.pyplot.legend -matplotlib.contour.ContourSet -matplotlib.contour.ContourSet.legend_elements +# - `matplotlib.axes.Axes.contour` / `matplotlib.pyplot.contour` +# - `matplotlib.axes.Axes.contourf` / `matplotlib.pyplot.contourf` +# - `matplotlib.figure.Figure.colorbar` / `matplotlib.pyplot.colorbar` +# - `matplotlib.axes.Axes.legend` / `matplotlib.pyplot.legend` +# - `matplotlib.contour.ContourSet` +# - `matplotlib.contour.ContourSet.legend_elements` diff --git a/examples/images_contours_and_fields/contourf_log.py b/examples/images_contours_and_fields/contourf_log.py index 813282249cd9..2f3976207b72 100644 --- a/examples/images_contours_and_fields/contourf_log.py +++ b/examples/images_contours_and_fields/contourf_log.py @@ -50,19 +50,12 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions, methods and classes is shown -# in this example: - -import matplotlib -matplotlib.axes.Axes.contourf -matplotlib.pyplot.contourf -matplotlib.figure.Figure.colorbar -matplotlib.pyplot.colorbar -matplotlib.axes.Axes.legend -matplotlib.pyplot.legend -matplotlib.ticker.LogLocator +# - `matplotlib.axes.Axes.contourf` / `matplotlib.pyplot.contourf` +# - `matplotlib.figure.Figure.colorbar` / `matplotlib.pyplot.colorbar` +# - `matplotlib.axes.Axes.legend` / `matplotlib.pyplot.legend` +# - `matplotlib.ticker.LogLocator` diff --git a/examples/images_contours_and_fields/image_annotated_heatmap.py b/examples/images_contours_and_fields/image_annotated_heatmap.py index 76e6f60a51e0..301c180cb783 100644 --- a/examples/images_contours_and_fields/image_annotated_heatmap.py +++ b/examples/images_contours_and_fields/image_annotated_heatmap.py @@ -305,15 +305,10 @@ def func(x, pos): ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The usage of the following functions and methods is shown in this example: - - -matplotlib.axes.Axes.imshow -matplotlib.pyplot.imshow -matplotlib.figure.Figure.colorbar -matplotlib.pyplot.colorbar +# - `matplotlib.axes.Axes.imshow` / `matplotlib.pyplot.imshow` +# - `matplotlib.figure.Figure.colorbar` / `matplotlib.pyplot.colorbar` diff --git a/examples/images_contours_and_fields/image_antialiasing.py b/examples/images_contours_and_fields/image_antialiasing.py index 9fd2e3954e31..3a6774c5e7e4 100644 --- a/examples/images_contours_and_fields/image_antialiasing.py +++ b/examples/images_contours_and_fields/image_antialiasing.py @@ -75,13 +75,9 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions and methods is shown -# in this example: - -import matplotlib -matplotlib.axes.Axes.imshow +# - `matplotlib.axes.Axes.imshow` diff --git a/examples/images_contours_and_fields/image_clip_path.py b/examples/images_contours_and_fields/image_clip_path.py index 3123be4138e0..f51dacb2a09e 100644 --- a/examples/images_contours_and_fields/image_clip_path.py +++ b/examples/images_contours_and_fields/image_clip_path.py @@ -23,15 +23,10 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions and methods is shown -# in this example: - -import matplotlib -matplotlib.axes.Axes.imshow -matplotlib.pyplot.imshow -matplotlib.artist.Artist.set_clip_path +# - `matplotlib.axes.Axes.imshow` / `matplotlib.pyplot.imshow` +# - `matplotlib.artist.Artist.set_clip_path` diff --git a/examples/images_contours_and_fields/image_demo.py b/examples/images_contours_and_fields/image_demo.py index d24169518ea1..d3630bf67d20 100644 --- a/examples/images_contours_and_fields/image_demo.py +++ b/examples/images_contours_and_fields/image_demo.py @@ -175,16 +175,11 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions and methods is shown -# in this example: - -import matplotlib -matplotlib.axes.Axes.imshow -matplotlib.pyplot.imshow -matplotlib.artist.Artist.set_clip_path -matplotlib.patches.PathPatch +# - `matplotlib.axes.Axes.imshow` / `matplotlib.pyplot.imshow` +# - `matplotlib.artist.Artist.set_clip_path` +# - `matplotlib.patches.PathPatch` diff --git a/examples/images_contours_and_fields/image_masked.py b/examples/images_contours_and_fields/image_masked.py index fff125abda63..2aa88f4f6b64 100644 --- a/examples/images_contours_and_fields/image_masked.py +++ b/examples/images_contours_and_fields/image_masked.py @@ -71,18 +71,12 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions and methods is shown -# in this example: - -import matplotlib -matplotlib.axes.Axes.imshow -matplotlib.pyplot.imshow -matplotlib.figure.Figure.colorbar -matplotlib.pyplot.colorbar -matplotlib.colors.BoundaryNorm -matplotlib.colorbar.ColorbarBase.set_label +# - `matplotlib.axes.Axes.imshow` / `matplotlib.pyplot.imshow` +# - `matplotlib.figure.Figure.colorbar` / `matplotlib.pyplot.colorbar` +# - `matplotlib.colors.BoundaryNorm` +# - `matplotlib.colorbar.ColorbarBase.set_label` diff --git a/examples/images_contours_and_fields/image_transparency_blend.py b/examples/images_contours_and_fields/image_transparency_blend.py index 7de2b42fedde..48e0a28c89b1 100644 --- a/examples/images_contours_and_fields/image_transparency_blend.py +++ b/examples/images_contours_and_fields/image_transparency_blend.py @@ -113,18 +113,12 @@ def normal_pdf(x, mean, var): ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions, methods and classes is shown -# in this example: - -import matplotlib -matplotlib.axes.Axes.imshow -matplotlib.pyplot.imshow -matplotlib.axes.Axes.contour -matplotlib.pyplot.contour -matplotlib.colors.Normalize -matplotlib.axes.Axes.set_axis_off +# - `matplotlib.axes.Axes.imshow` / `matplotlib.pyplot.imshow` +# - `matplotlib.axes.Axes.contour` / `matplotlib.pyplot.contour` +# - `matplotlib.colors.Normalize` +# - `matplotlib.axes.Axes.set_axis_off` diff --git a/examples/images_contours_and_fields/interpolation_methods.py b/examples/images_contours_and_fields/interpolation_methods.py index e392c476d098..1e59e721d9fa 100644 --- a/examples/images_contours_and_fields/interpolation_methods.py +++ b/examples/images_contours_and_fields/interpolation_methods.py @@ -42,14 +42,9 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions and methods is shown -# in this example: - -import matplotlib -matplotlib.axes.Axes.imshow -matplotlib.pyplot.imshow +# - `matplotlib.axes.Axes.imshow` / `matplotlib.pyplot.imshow` diff --git a/examples/images_contours_and_fields/irregulardatagrid.py b/examples/images_contours_and_fields/irregulardatagrid.py index 523273a920f9..aedf8033c9b4 100644 --- a/examples/images_contours_and_fields/irregulardatagrid.py +++ b/examples/images_contours_and_fields/irregulardatagrid.py @@ -83,19 +83,12 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions and methods is shown in this example: - -import matplotlib -matplotlib.axes.Axes.contour -matplotlib.pyplot.contour -matplotlib.axes.Axes.contourf -matplotlib.pyplot.contourf -matplotlib.axes.Axes.tricontour -matplotlib.pyplot.tricontour -matplotlib.axes.Axes.tricontourf -matplotlib.pyplot.tricontourf +# - `matplotlib.axes.Axes.contour` / `matplotlib.pyplot.contour` +# - `matplotlib.axes.Axes.contourf` / `matplotlib.pyplot.contourf` +# - `matplotlib.axes.Axes.tricontour` / `matplotlib.pyplot.tricontour` +# - `matplotlib.axes.Axes.tricontourf` / `matplotlib.pyplot.tricontourf` diff --git a/examples/images_contours_and_fields/layer_images.py b/examples/images_contours_and_fields/layer_images.py index 5b2ba0738a68..abd8b2a9008e 100644 --- a/examples/images_contours_and_fields/layer_images.py +++ b/examples/images_contours_and_fields/layer_images.py @@ -43,14 +43,9 @@ def func3(x, y): ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions and methods is shown -# in this example: - -import matplotlib -matplotlib.axes.Axes.imshow -matplotlib.pyplot.imshow +# - `matplotlib.axes.Axes.imshow` / `matplotlib.pyplot.imshow` diff --git a/examples/images_contours_and_fields/matshow.py b/examples/images_contours_and_fields/matshow.py index fbe93921c670..43a06bda9353 100644 --- a/examples/images_contours_and_fields/matshow.py +++ b/examples/images_contours_and_fields/matshow.py @@ -17,14 +17,9 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions and methods is shown -# in this example: - -import matplotlib -matplotlib.axes.Axes.matshow -matplotlib.pyplot.matshow +# - `matplotlib.axes.Axes.imshow` / `matplotlib.pyplot.imshow` diff --git a/examples/images_contours_and_fields/multi_image.py b/examples/images_contours_and_fields/multi_image.py index aa9067e55d06..82b1a072a1b6 100644 --- a/examples/images_contours_and_fields/multi_image.py +++ b/examples/images_contours_and_fields/multi_image.py @@ -53,21 +53,15 @@ def update(changed_image): ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions, methods and classes is shown -# in this example: - -import matplotlib -matplotlib.axes.Axes.imshow -matplotlib.pyplot.imshow -matplotlib.figure.Figure.colorbar -matplotlib.pyplot.colorbar -matplotlib.colors.Normalize -matplotlib.cm.ScalarMappable.set_cmap -matplotlib.cm.ScalarMappable.set_norm -matplotlib.cm.ScalarMappable.set_clim -matplotlib.cbook.CallbackRegistry.connect +# - `matplotlib.axes.Axes.imshow` / `matplotlib.pyplot.imshow` +# - `matplotlib.figure.Figure.colorbar` / `matplotlib.pyplot.colorbar` +# - `matplotlib.colors.Normalize` +# - `matplotlib.cm.ScalarMappable.set_cmap` +# - `matplotlib.cm.ScalarMappable.set_norm` +# - `matplotlib.cm.ScalarMappable.set_clim` +# - `matplotlib.cbook.CallbackRegistry.connect` diff --git a/examples/images_contours_and_fields/pcolor_demo.py b/examples/images_contours_and_fields/pcolor_demo.py index 4862bb583288..bc578f25cf09 100644 --- a/examples/images_contours_and_fields/pcolor_demo.py +++ b/examples/images_contours_and_fields/pcolor_demo.py @@ -111,22 +111,14 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions, methods and classes is shown -# in this example: - -import matplotlib -matplotlib.axes.Axes.pcolor -matplotlib.pyplot.pcolor -matplotlib.axes.Axes.pcolormesh -matplotlib.pyplot.pcolormesh -matplotlib.axes.Axes.pcolorfast -matplotlib.axes.Axes.imshow -matplotlib.pyplot.imshow -matplotlib.figure.Figure.colorbar -matplotlib.pyplot.colorbar -matplotlib.colors.LogNorm +# - `matplotlib.axes.Axes.pcolor` / `matplotlib.pyplot.pcolor` +# - `matplotlib.axes.Axes.pcolormesh` / `matplotlib.pyplot.pcolormesh` +# - `matplotlib.axes.Axes.pcolorfast` +# - `matplotlib.axes.Axes.imshow` / `matplotlib.pyplot.imshow` +# - `matplotlib.figure.Figure.colorbar` / `matplotlib.pyplot.colorbar` +# - `matplotlib.colors.LogNorm` diff --git a/examples/images_contours_and_fields/pcolormesh_grids.py b/examples/images_contours_and_fields/pcolormesh_grids.py index 202a9d167616..3b628efe58bd 100644 --- a/examples/images_contours_and_fields/pcolormesh_grids.py +++ b/examples/images_contours_and_fields/pcolormesh_grids.py @@ -15,7 +15,6 @@ """ -import matplotlib import matplotlib.pyplot as plt import numpy as np @@ -121,12 +120,9 @@ def _annotate(ax, x, y, title): plt.show() ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions and methods is shown in this example: - -matplotlib.axes.Axes.pcolormesh -matplotlib.pyplot.pcolormesh +# - `matplotlib.axes.Axes.pcolormesh` / `matplotlib.pyplot.pcolormesh` diff --git a/examples/images_contours_and_fields/pcolormesh_levels.py b/examples/images_contours_and_fields/pcolormesh_levels.py index 7f1073295709..143a83cf2683 100644 --- a/examples/images_contours_and_fields/pcolormesh_levels.py +++ b/examples/images_contours_and_fields/pcolormesh_levels.py @@ -8,7 +8,6 @@ """ -import matplotlib import matplotlib.pyplot as plt from matplotlib.colors import BoundaryNorm from matplotlib.ticker import MaxNLocator @@ -121,18 +120,13 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions and methods is shown in this example: - -matplotlib.axes.Axes.pcolormesh -matplotlib.pyplot.pcolormesh -matplotlib.axes.Axes.contourf -matplotlib.pyplot.contourf -matplotlib.figure.Figure.colorbar -matplotlib.pyplot.colorbar -matplotlib.colors.BoundaryNorm -matplotlib.ticker.MaxNLocator +# - `matplotlib.axes.Axes.pcolormesh` / `matplotlib.pyplot.pcolormesh` +# - `matplotlib.axes.Axes.contourf` / `matplotlib.pyplot.contourf` +# - `matplotlib.figure.Figure.colorbar` / `matplotlib.pyplot.colorbar` +# - `matplotlib.colors.BoundaryNorm` +# - `matplotlib.ticker.MaxNLocator` diff --git a/examples/images_contours_and_fields/plot_streamplot.py b/examples/images_contours_and_fields/plot_streamplot.py index 2051764bb383..fca97d304207 100644 --- a/examples/images_contours_and_fields/plot_streamplot.py +++ b/examples/images_contours_and_fields/plot_streamplot.py @@ -72,15 +72,10 @@ plt.show() ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions and methods is shown in this example: - -import matplotlib -matplotlib.axes.Axes.streamplot -matplotlib.pyplot.streamplot -matplotlib.gridspec -matplotlib.gridspec.GridSpec +# - `matplotlib.axes.Axes.streamplot` / `matplotlib.pyplot.streamplot` +# - `matplotlib.gridspec.GridSpec` diff --git a/examples/images_contours_and_fields/quadmesh_demo.py b/examples/images_contours_and_fields/quadmesh_demo.py index 005d693f7aa0..9310f5ad00c7 100644 --- a/examples/images_contours_and_fields/quadmesh_demo.py +++ b/examples/images_contours_and_fields/quadmesh_demo.py @@ -42,13 +42,9 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions and methods is shown in this example: - -import matplotlib -matplotlib.axes.Axes.pcolormesh -matplotlib.pyplot.pcolormesh +# - `matplotlib.axes.Axes.pcolormesh` / `matplotlib.pyplot.pcolormesh` diff --git a/examples/images_contours_and_fields/quiver_demo.py b/examples/images_contours_and_fields/quiver_demo.py index f06f4e17198a..396e1c047e1b 100644 --- a/examples/images_contours_and_fields/quiver_demo.py +++ b/examples/images_contours_and_fields/quiver_demo.py @@ -54,15 +54,10 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions and methods is shown in this example: - -import matplotlib -matplotlib.axes.Axes.quiver -matplotlib.pyplot.quiver -matplotlib.axes.Axes.quiverkey -matplotlib.pyplot.quiverkey +# - `matplotlib.axes.Axes.quiver` / `matplotlib.pyplot.quiver` +# - `matplotlib.axes.Axes.quiverkey` / `matplotlib.pyplot.quiverkey` diff --git a/examples/images_contours_and_fields/quiver_simple_demo.py b/examples/images_contours_and_fields/quiver_simple_demo.py index 0393a4857cbd..1437d6f138c2 100644 --- a/examples/images_contours_and_fields/quiver_simple_demo.py +++ b/examples/images_contours_and_fields/quiver_simple_demo.py @@ -24,15 +24,10 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions and methods is shown in this example: - -import matplotlib -matplotlib.axes.Axes.quiver -matplotlib.pyplot.quiver -matplotlib.axes.Axes.quiverkey -matplotlib.pyplot.quiverkey +# - `matplotlib.axes.Axes.quiver` / `matplotlib.pyplot.quiver` +# - `matplotlib.axes.Axes.quiverkey` / `matplotlib.pyplot.quiverkey` diff --git a/examples/images_contours_and_fields/shading_example.py b/examples/images_contours_and_fields/shading_example.py index e1357f26070f..63858a8fb19e 100644 --- a/examples/images_contours_and_fields/shading_example.py +++ b/examples/images_contours_and_fields/shading_example.py @@ -64,15 +64,10 @@ def compare(z, cmap, ve=1): ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions, methods and classes is shown in this -# example: - -import matplotlib -matplotlib.colors.LightSource -matplotlib.axes.Axes.imshow -matplotlib.pyplot.imshow +# - `matplotlib.colors.LightSource` +# - `matplotlib.axes.Axes.imshow` / `matplotlib.pyplot.imshow` diff --git a/examples/images_contours_and_fields/specgram_demo.py b/examples/images_contours_and_fields/specgram_demo.py index 6a7eb8d696f8..43ee7b3c1af8 100644 --- a/examples/images_contours_and_fields/specgram_demo.py +++ b/examples/images_contours_and_fields/specgram_demo.py @@ -38,14 +38,9 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions, methods is shown -# in this example: - -import matplotlib -matplotlib.axes.Axes.specgram -matplotlib.pyplot.specgram +# - `matplotlib.axes.Axes.specgram` / `matplotlib.pyplot.specgram` diff --git a/examples/images_contours_and_fields/spy_demos.py b/examples/images_contours_and_fields/spy_demos.py index af70f48cd4c8..a61a3ffefcad 100644 --- a/examples/images_contours_and_fields/spy_demos.py +++ b/examples/images_contours_and_fields/spy_demos.py @@ -33,14 +33,9 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions, methods and classes is shown -# in this example: - -import matplotlib -matplotlib.axes.Axes.spy -matplotlib.pyplot.spy +# - `matplotlib.axes.Axes.spy` / `matplotlib.pyplot.spy` diff --git a/examples/images_contours_and_fields/tricontour_demo.py b/examples/images_contours_and_fields/tricontour_demo.py index d657aef01af7..6b7da8d25d85 100644 --- a/examples/images_contours_and_fields/tricontour_demo.py +++ b/examples/images_contours_and_fields/tricontour_demo.py @@ -113,15 +113,10 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions, methods and classes is shown -# in this example: - -import matplotlib -matplotlib.axes.Axes.tricontourf -matplotlib.pyplot.tricontourf -matplotlib.tri.Triangulation +# - `matplotlib.axes.Axes.tricontourf` / `matplotlib.pyplot.tricontourf` +# - `matplotlib.tri.Triangulation` diff --git a/examples/lines_bars_and_markers/bar_label_demo.py b/examples/lines_bars_and_markers/bar_label_demo.py index 3b5db07d71dd..9b353376a53e 100644 --- a/examples/lines_bars_and_markers/bar_label_demo.py +++ b/examples/lines_bars_and_markers/bar_label_demo.py @@ -14,7 +14,6 @@ ` examples. """ -import matplotlib import matplotlib.pyplot as plt import numpy as np @@ -100,17 +99,11 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions, methods and classes is shown -# in this example: - -matplotlib.axes.Axes.bar -matplotlib.pyplot.bar -matplotlib.axes.Axes.barh -matplotlib.pyplot.barh -matplotlib.axes.Axes.bar_label -matplotlib.pyplot.bar_label +# - `matplotlib.axes.Axes.bar` / `matplotlib.pyplot.bar` +# - `matplotlib.axes.Axes.barh` / `matplotlib.pyplot.barh` +# - `matplotlib.axes.Axes.bar_label` / `matplotlib.pyplot.bar_label` diff --git a/examples/lines_bars_and_markers/barchart.py b/examples/lines_bars_and_markers/barchart.py index 1140381870aa..71ae2ca0f8f3 100644 --- a/examples/lines_bars_and_markers/barchart.py +++ b/examples/lines_bars_and_markers/barchart.py @@ -7,7 +7,6 @@ bars with labels. """ -import matplotlib import matplotlib.pyplot as plt import numpy as np @@ -39,15 +38,10 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions, methods and classes is shown -# in this example: - -matplotlib.axes.Axes.bar -matplotlib.pyplot.bar -matplotlib.axes.Axes.bar_label -matplotlib.pyplot.bar_label +# - `matplotlib.axes.Axes.bar` / `matplotlib.pyplot.bar` +# - `matplotlib.axes.Axes.bar_label` / `matplotlib.pyplot.bar_label` diff --git a/examples/lines_bars_and_markers/curve_error_band.py b/examples/lines_bars_and_markers/curve_error_band.py index 3d1675570b24..56d95977a54c 100644 --- a/examples/lines_bars_and_markers/curve_error_band.py +++ b/examples/lines_bars_and_markers/curve_error_band.py @@ -71,14 +71,10 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions, methods and classes is shown -# in this example: - -import matplotlib -matplotlib.patches.PathPatch -matplotlib.path.Path +# - `matplotlib.patches.PathPatch` +# - `matplotlib.path.Path` diff --git a/examples/lines_bars_and_markers/fill_between_demo.py b/examples/lines_bars_and_markers/fill_between_demo.py index 8f7e7c11d024..cc9d4ddab11a 100644 --- a/examples/lines_bars_and_markers/fill_between_demo.py +++ b/examples/lines_bars_and_markers/fill_between_demo.py @@ -132,15 +132,10 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions, methods and classes is shown -# in this example: - -import matplotlib -matplotlib.axes.Axes.fill_between -matplotlib.pyplot.fill_between -matplotlib.axes.Axes.get_xaxis_transform +# - `matplotlib.axes.Axes.fill_between` / `matplotlib.pyplot.fill_between` +# - `matplotlib.axes.Axes.get_xaxis_transform` diff --git a/examples/lines_bars_and_markers/hat_graph.py b/examples/lines_bars_and_markers/hat_graph.py index 4c29f6f85625..f7658c97b036 100644 --- a/examples/lines_bars_and_markers/hat_graph.py +++ b/examples/lines_bars_and_markers/hat_graph.py @@ -7,7 +7,6 @@ .. _hat graph: https://doi.org/10.1186/s41235-019-0182-3 """ -import matplotlib import numpy as np import matplotlib.pyplot as plt @@ -73,14 +72,10 @@ def label_bars(heights, rects): plt.show() ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions, methods and classes is shown -# in this example: -matplotlib.axes.Axes.bar -matplotlib.pyplot.bar -matplotlib.axes.Axes.annotate -matplotlib.pyplot.annotate +# - `matplotlib.axes.Axes.bar` / `matplotlib.pyplot.bar` +# - `matplotlib.axes.Axes.annotate` / `matplotlib.pyplot.annotate` diff --git a/examples/lines_bars_and_markers/scatter_hist.py b/examples/lines_bars_and_markers/scatter_hist.py index 73fbee3dc6a2..1ad5d8ac1c8b 100644 --- a/examples/lines_bars_and_markers/scatter_hist.py +++ b/examples/lines_bars_and_markers/scatter_hist.py @@ -113,17 +113,13 @@ def scatter_hist(x, y, ax, ax_histx, ax_histy): ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions, methods and classes is shown -# in this example: - -import matplotlib -matplotlib.figure.Figure.add_axes -matplotlib.figure.Figure.add_subplot -matplotlib.figure.Figure.add_gridspec -matplotlib.axes.Axes.scatter -matplotlib.axes.Axes.hist +# - `matplotlib.figure.Figure.add_axes` +# - `matplotlib.figure.Figure.add_subplot` +# - `matplotlib.figure.Figure.add_gridspec` +# - `matplotlib.axes.Axes.scatter` +# - `matplotlib.axes.Axes.hist` diff --git a/examples/lines_bars_and_markers/scatter_with_legend.py b/examples/lines_bars_and_markers/scatter_with_legend.py index 6ff312711aa5..fed8dd1c44f7 100644 --- a/examples/lines_bars_and_markers/scatter_with_legend.py +++ b/examples/lines_bars_and_markers/scatter_with_legend.py @@ -100,16 +100,11 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The usage of the following functions and methods is shown in this example: - -import matplotlib -matplotlib.axes.Axes.scatter -matplotlib.pyplot.scatter -matplotlib.axes.Axes.legend -matplotlib.pyplot.legend -matplotlib.collections.PathCollection.legend_elements +# - `matplotlib.axes.Axes.scatter` / `matplotlib.pyplot.scatter` +# - `matplotlib.axes.Axes.legend` / `matplotlib.pyplot.legend` +# - `matplotlib.collections.PathCollection.legend_elements` diff --git a/examples/lines_bars_and_markers/simple_plot.py b/examples/lines_bars_and_markers/simple_plot.py index f51e16015b2e..86b51db41259 100644 --- a/examples/lines_bars_and_markers/simple_plot.py +++ b/examples/lines_bars_and_markers/simple_plot.py @@ -6,7 +6,6 @@ Create a simple plot. """ -import matplotlib import matplotlib.pyplot as plt import numpy as np @@ -26,14 +25,11 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions and methods is shown in this example: - -matplotlib.axes.Axes.plot -matplotlib.pyplot.plot -matplotlib.pyplot.subplots -matplotlib.figure.Figure.savefig +# - `matplotlib.axes.Axes.plot` / `matplotlib.pyplot.plot` +# - `matplotlib.pyplot.subplots` +# - `matplotlib.figure.Figure.savefig` diff --git a/examples/lines_bars_and_markers/timeline.py b/examples/lines_bars_and_markers/timeline.py index ee1d016f8f95..087e7320f6b8 100644 --- a/examples/lines_bars_and_markers/timeline.py +++ b/examples/lines_bars_and_markers/timeline.py @@ -97,18 +97,14 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions, methods and classes is shown -# in this example: - -import matplotlib -matplotlib.axes.Axes.annotate -matplotlib.axes.Axes.vlines -matplotlib.axis.Axis.set_major_locator -matplotlib.axis.Axis.set_major_formatter -matplotlib.dates.MonthLocator -matplotlib.dates.DateFormatter +# - `matplotlib.axes.Axes.annotate` +# - `matplotlib.axes.Axes.vlines` +# - `matplotlib.axis.Axis.set_major_locator` +# - `matplotlib.axis.Axis.set_major_formatter` +# - `matplotlib.dates.MonthLocator` +# - `matplotlib.dates.DateFormatter` diff --git a/examples/shapes_and_collections/scatter.py b/examples/shapes_and_collections/scatter.py index 673766a6ea4f..f5ecd8f10139 100644 --- a/examples/shapes_and_collections/scatter.py +++ b/examples/shapes_and_collections/scatter.py @@ -23,13 +23,9 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions and methods is shown in this example: -import matplotlib - -matplotlib.axes.Axes.scatter -matplotlib.pyplot.scatter +# - `matplotlib.axes.Axes.scatter` / `matplotlib.pyplot.scatter` diff --git a/examples/statistics/barchart_demo.py b/examples/statistics/barchart_demo.py index e9c2b94c0b95..8c549b0cdb70 100644 --- a/examples/statistics/barchart_demo.py +++ b/examples/statistics/barchart_demo.py @@ -16,7 +16,6 @@ """ import numpy as np -import matplotlib import matplotlib.pyplot as plt from matplotlib.ticker import MaxNLocator from collections import namedtuple @@ -161,16 +160,11 @@ def plot_student_results(student, scores, cohort_size): ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions, methods and classes is shown -# in this example: - -matplotlib.axes.Axes.bar -matplotlib.pyplot.bar -matplotlib.axes.Axes.annotate -matplotlib.pyplot.annotate -matplotlib.axes.Axes.twinx +# - `matplotlib.axes.Axes.bar` / `matplotlib.pyplot.bar` +# - `matplotlib.axes.Axes.annotate` / `matplotlib.pyplot.annotate` +# - `matplotlib.axes.Axes.twinx` / `matplotlib.pyplot.twinx` diff --git a/examples/statistics/boxplot.py b/examples/statistics/boxplot.py index 9c5d7dd29186..7ade156c7bb4 100644 --- a/examples/statistics/boxplot.py +++ b/examples/statistics/boxplot.py @@ -98,13 +98,9 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions and methods is shown in this example: - -import matplotlib -matplotlib.axes.Axes.boxplot -matplotlib.pyplot.boxplot +# - `matplotlib.axes.Axes.boxplot` / `matplotlib.pyplot.boxplot` diff --git a/examples/statistics/boxplot_color.py b/examples/statistics/boxplot_color.py index c1c00c607590..c26b6672f567 100644 --- a/examples/statistics/boxplot_color.py +++ b/examples/statistics/boxplot_color.py @@ -54,13 +54,9 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions and methods is shown in this example: - -import matplotlib -matplotlib.axes.Axes.boxplot -matplotlib.pyplot.boxplot +# - `matplotlib.axes.Axes.boxplot` / `matplotlib.pyplot.boxplot` diff --git a/examples/statistics/boxplot_demo.py b/examples/statistics/boxplot_demo.py index d5eb08f9cf1d..b3bb44a1a96c 100644 --- a/examples/statistics/boxplot_demo.py +++ b/examples/statistics/boxplot_demo.py @@ -233,14 +233,10 @@ def fake_bootstrapper(n): ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions and methods is shown in this example: - -import matplotlib -matplotlib.axes.Axes.boxplot -matplotlib.pyplot.boxplot -matplotlib.axes.Axes.set +# - `matplotlib.axes.Axes.boxplot` / `matplotlib.pyplot.boxplot` +# - `matplotlib.artist.Artist.set` / `matplotlib.pyplot.setp` diff --git a/examples/statistics/boxplot_vs_violin.py b/examples/statistics/boxplot_vs_violin.py index 5107a45f0dcb..6f5d8de06f3b 100644 --- a/examples/statistics/boxplot_vs_violin.py +++ b/examples/statistics/boxplot_vs_violin.py @@ -56,15 +56,10 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions and methods is shown in this example: - -import matplotlib -matplotlib.axes.Axes.boxplot -matplotlib.pyplot.boxplot -matplotlib.axes.Axes.violinplot -matplotlib.pyplot.violinplot +# - `matplotlib.axes.Axes.boxplot` / `matplotlib.pyplot.boxplot` +# - `matplotlib.axes.Axes.violinplot` / `matplotlib.pyplot.violinplot` diff --git a/examples/statistics/bxp.py b/examples/statistics/bxp.py index b5e22be0e0d2..374db300b5bd 100644 --- a/examples/statistics/bxp.py +++ b/examples/statistics/bxp.py @@ -105,13 +105,10 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions and methods is shown in this example: - -import matplotlib -matplotlib.axes.Axes.bxp -matplotlib.cbook.boxplot_stats +# - `matplotlib.axes.Axes.bxp` +# - `matplotlib.cbook.boxplot_stats` diff --git a/examples/statistics/confidence_ellipse.py b/examples/statistics/confidence_ellipse.py index 06d5523f522e..16b9d32c557e 100644 --- a/examples/statistics/confidence_ellipse.py +++ b/examples/statistics/confidence_ellipse.py @@ -217,13 +217,10 @@ def get_correlated_dataset(n, dependency, mu, scale): ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions and methods is shown in this example: - -import matplotlib -matplotlib.transforms.Affine2D -matplotlib.patches.Ellipse +# - `matplotlib.transforms.Affine2D` +# - `matplotlib.patches.Ellipse` diff --git a/examples/statistics/customized_violin.py b/examples/statistics/customized_violin.py index 61c52c2d9a87..22ef8407b832 100644 --- a/examples/statistics/customized_violin.py +++ b/examples/statistics/customized_violin.py @@ -77,15 +77,10 @@ def set_axis_style(ax, labels): ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions and methods is shown in this example: - -import matplotlib -matplotlib.axes.Axes.violinplot -matplotlib.pyplot.violinplot -matplotlib.axes.Axes.vlines -matplotlib.pyplot.vlines +# - `matplotlib.axes.Axes.violinplot` / `matplotlib.pyplot.violinplot` +# - `matplotlib.axes.Axes.vlines` / `matplotlib.pyplot.vlines` diff --git a/examples/statistics/errorbar.py b/examples/statistics/errorbar.py index c6c0a8d61704..8d674095b4e4 100644 --- a/examples/statistics/errorbar.py +++ b/examples/statistics/errorbar.py @@ -21,13 +21,9 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions and methods is shown in this example: - -import matplotlib -matplotlib.axes.Axes.errorbar -matplotlib.pyplot.errorbar +# - `matplotlib.axes.Axes.errorbar` / `matplotlib.pyplot.errorbar` diff --git a/examples/statistics/errorbar_features.py b/examples/statistics/errorbar_features.py index 253d0008dcae..78e80f0aeb88 100644 --- a/examples/statistics/errorbar_features.py +++ b/examples/statistics/errorbar_features.py @@ -48,13 +48,9 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions and methods is shown in this example: - -import matplotlib -matplotlib.axes.Axes.errorbar -matplotlib.pyplot.errorbar +# - `matplotlib.axes.Axes.errorbar` / `matplotlib.pyplot.errorbar` diff --git a/examples/statistics/errorbar_limits.py b/examples/statistics/errorbar_limits.py index 914fef4cdbbc..5013b82ed977 100644 --- a/examples/statistics/errorbar_limits.py +++ b/examples/statistics/errorbar_limits.py @@ -77,13 +77,9 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions and methods is shown in this example: - -import matplotlib -matplotlib.axes.Axes.errorbar -matplotlib.pyplot.errorbar +# - `matplotlib.axes.Axes.errorbar` / `matplotlib.pyplot.errorbar` diff --git a/examples/statistics/errorbars_and_boxes.py b/examples/statistics/errorbars_and_boxes.py index 7c647aedaadd..582edfbb27e1 100644 --- a/examples/statistics/errorbars_and_boxes.py +++ b/examples/statistics/errorbars_and_boxes.py @@ -70,15 +70,11 @@ def make_error_boxes(ax, xdata, ydata, xerror, yerror, facecolor='r', ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions and methods is shown in this example: - -import matplotlib -matplotlib.axes.Axes.errorbar -matplotlib.pyplot.errorbar -matplotlib.axes.Axes.add_collection -matplotlib.collections.PatchCollection +# - `matplotlib.axes.Axes.errorbar` / `matplotlib.pyplot.errorbar` +# - `matplotlib.axes.Axes.add_collection` +# - `matplotlib.collections.PatchCollection` diff --git a/examples/statistics/hexbin_demo.py b/examples/statistics/hexbin_demo.py index 3d8e85cf8f00..759be95658f6 100644 --- a/examples/statistics/hexbin_demo.py +++ b/examples/statistics/hexbin_demo.py @@ -45,13 +45,9 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions and methods is shown in this example: - -import matplotlib -matplotlib.axes.Axes.hexbin -matplotlib.pyplot.hexbin +# - `matplotlib.axes.Axes.hexbin` / `matplotlib.pyplot.hexbin` diff --git a/examples/statistics/hist.py b/examples/statistics/hist.py index 5fd409911c89..3ca0871f4d04 100644 --- a/examples/statistics/hist.py +++ b/examples/statistics/hist.py @@ -103,15 +103,11 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions and methods is shown in this example: - -import matplotlib -matplotlib.axes.Axes.hist -matplotlib.pyplot.hist -matplotlib.pyplot.hist2d -matplotlib.ticker.PercentFormatter +# - `matplotlib.axes.Axes.hist` / `matplotlib.pyplot.hist` +# - `matplotlib.pyplot.hist2d` +# - `matplotlib.ticker.PercentFormatter` diff --git a/examples/statistics/histogram_cumulative.py b/examples/statistics/histogram_cumulative.py index f5da13aa49fe..68151d027c44 100644 --- a/examples/statistics/histogram_cumulative.py +++ b/examples/statistics/histogram_cumulative.py @@ -73,13 +73,9 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions and methods is shown in this example: - -import matplotlib -matplotlib.axes.Axes.hist -matplotlib.pyplot.hist +# - `matplotlib.axes.Axes.hist` / `matplotlib.pyplot.hist` diff --git a/examples/statistics/histogram_features.py b/examples/statistics/histogram_features.py index 27c4940822d8..31f88384f24c 100644 --- a/examples/statistics/histogram_features.py +++ b/examples/statistics/histogram_features.py @@ -48,16 +48,12 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions and methods is shown in this example: - -import matplotlib -matplotlib.axes.Axes.hist -matplotlib.pyplot.hist -matplotlib.axes.Axes.set_title -matplotlib.axes.Axes.set_xlabel -matplotlib.axes.Axes.set_ylabel +# - `matplotlib.axes.Axes.hist` / `matplotlib.pyplot.hist` +# - `matplotlib.axes.Axes.set_title` +# - `matplotlib.axes.Axes.set_xlabel` +# - `matplotlib.axes.Axes.set_ylabel` diff --git a/examples/statistics/histogram_histtypes.py b/examples/statistics/histogram_histtypes.py index c22c96329be0..ca5c051d943c 100644 --- a/examples/statistics/histogram_histtypes.py +++ b/examples/statistics/histogram_histtypes.py @@ -51,13 +51,9 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions and methods is shown in this example: - -import matplotlib -matplotlib.axes.Axes.hist -matplotlib.pyplot.hist +# - `matplotlib.axes.Axes.hist` / `matplotlib.pyplot.hist` diff --git a/examples/statistics/histogram_multihist.py b/examples/statistics/histogram_multihist.py index 65c7b11f337e..c832259c6670 100644 --- a/examples/statistics/histogram_multihist.py +++ b/examples/statistics/histogram_multihist.py @@ -47,13 +47,9 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions and methods is shown in this example: - -import matplotlib -matplotlib.axes.Axes.hist -matplotlib.pyplot.hist +# - `matplotlib.axes.Axes.hist` / `matplotlib.pyplot.hist` diff --git a/examples/statistics/multiple_histograms_side_by_side.py b/examples/statistics/multiple_histograms_side_by_side.py index eef1a22602e4..b62dbf175355 100644 --- a/examples/statistics/multiple_histograms_side_by_side.py +++ b/examples/statistics/multiple_histograms_side_by_side.py @@ -64,13 +64,9 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions and methods is shown in this example: - -import matplotlib -matplotlib.axes.Axes.barh -matplotlib.pyplot.barh +# - `matplotlib.axes.Axes.barh` / `matplotlib.pyplot.barh` diff --git a/examples/statistics/time_series_histogram.py b/examples/statistics/time_series_histogram.py index c0e95f93bfc6..94f904fab91e 100644 --- a/examples/statistics/time_series_histogram.py +++ b/examples/statistics/time_series_histogram.py @@ -97,14 +97,10 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions and methods is shown in this example: - -import matplotlib -matplotlib.axes.Axes.pcolormesh -matplotlib.pyplot.pcolormesh -matplotlib.figure.Figure.colorbar +# - `matplotlib.axes.Axes.pcolormesh` / `matplotlib.pyplot.pcolormesh` +# - `matplotlib.figure.Figure.colorbar` diff --git a/examples/statistics/violinplot.py b/examples/statistics/violinplot.py index a2ff6aed61ba..7c9c894f7aec 100644 --- a/examples/statistics/violinplot.py +++ b/examples/statistics/violinplot.py @@ -88,13 +88,9 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions and methods is shown in this example: - -import matplotlib -matplotlib.axes.Axes.violinplot -matplotlib.pyplot.violinplot +# - `matplotlib.axes.Axes.violinplot` / `matplotlib.pyplot.violinplot` diff --git a/examples/subplots_axes_and_figures/axes_box_aspect.py b/examples/subplots_axes_and_figures/axes_box_aspect.py index 6acfcb6046f9..4444f0f28366 100644 --- a/examples/subplots_axes_and_figures/axes_box_aspect.py +++ b/examples/subplots_axes_and_figures/axes_box_aspect.py @@ -19,7 +19,6 @@ # # Produce a square axes, no matter what the data limits are. -import matplotlib import numpy as np import matplotlib.pyplot as plt @@ -148,12 +147,9 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions, methods and classes is shown -# in this example: - -matplotlib.axes.Axes.set_box_aspect +# - `matplotlib.axes.Axes.set_box_aspect` diff --git a/examples/subplots_axes_and_figures/axes_margins.py b/examples/subplots_axes_and_figures/axes_margins.py index 41347f715d4d..d532f6138fe8 100644 --- a/examples/subplots_axes_and_figures/axes_margins.py +++ b/examples/subplots_axes_and_figures/axes_margins.py @@ -13,6 +13,7 @@ import numpy as np import matplotlib.pyplot as plt +from matplotlib.patches import Polygon def f(t): @@ -64,7 +65,7 @@ def f(t): for ax, status in zip((ax1, ax2), ('Is', 'Is Not')): cells = ax.pcolor(x, y, x+y, cmap='inferno', shading='auto') # sticky ax.add_patch( - plt.Polygon(poly_coords, color='forestgreen', alpha=0.5) + Polygon(poly_coords, color='forestgreen', alpha=0.5) ) # not sticky ax.margins(x=0.1, y=0.05) ax.set_aspect('equal') @@ -75,18 +76,12 @@ def f(t): ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions, methods is shown -# in this example: - -import matplotlib -matplotlib.axes.Axes.margins -matplotlib.pyplot.margins -matplotlib.axes.Axes.use_sticky_edges -matplotlib.axes.Axes.pcolor -matplotlib.pyplot.pcolor -matplotlib.pyplot.Polygon +# - `matplotlib.axes.Axes.margins` / `matplotlib.pyplot.margins` +# - `matplotlib.axes.Axes.use_sticky_edges` +# - `matplotlib.axes.Axes.pcolor` / `matplotlib.pyplot.pcolor` +# - `matplotlib.patches.Polygon` diff --git a/examples/subplots_axes_and_figures/demo_constrained_layout.py b/examples/subplots_axes_and_figures/demo_constrained_layout.py index e7aca95777d7..26109cbe3129 100644 --- a/examples/subplots_axes_and_figures/demo_constrained_layout.py +++ b/examples/subplots_axes_and_figures/demo_constrained_layout.py @@ -62,13 +62,10 @@ def example_plot(ax): ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions and methods is shown in this example: - -import matplotlib -matplotlib.gridspec.GridSpec -matplotlib.gridspec.GridSpecFromSubplotSpec +# - `matplotlib.gridspec.GridSpec` +# - `matplotlib.gridspec.GridSpecFromSubplotSpec` diff --git a/examples/subplots_axes_and_figures/demo_tight_layout.py b/examples/subplots_axes_and_figures/demo_tight_layout.py index 75eb8a44aa40..edf79910c590 100644 --- a/examples/subplots_axes_and_figures/demo_tight_layout.py +++ b/examples/subplots_axes_and_figures/demo_tight_layout.py @@ -135,16 +135,12 @@ def example_plot(ax): ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions and methods is shown in this example: - -import matplotlib -matplotlib.pyplot.tight_layout -matplotlib.figure.Figure.tight_layout -matplotlib.figure.Figure.add_gridspec -matplotlib.figure.Figure.add_subplot -matplotlib.pyplot.subplot2grid +# - `matplotlib.figure.Figure.tight_layout` / `matplotlib.pyplot.tight_layout` +# - `matplotlib.figure.Figure.add_gridspec` +# - `matplotlib.figure.Figure.add_subplot` +# - `matplotlib.pyplot.subplot2grid` diff --git a/examples/subplots_axes_and_figures/figure_size_units.py b/examples/subplots_axes_and_figures/figure_size_units.py index f3154267ac50..82063ad4577d 100644 --- a/examples/subplots_axes_and_figures/figure_size_units.py +++ b/examples/subplots_axes_and_figures/figure_size_units.py @@ -71,15 +71,11 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions and methods is shown in this example: - -import matplotlib - -matplotlib.pyplot.figure -matplotlib.pyplot.subplots -matplotlib.pyplot.subplot_mosaic +# - `matplotlib.pyplot.figure` +# - `matplotlib.pyplot.subplots` +# - `matplotlib.pyplot.subplot_mosaic` diff --git a/examples/subplots_axes_and_figures/secondary_axis.py b/examples/subplots_axes_and_figures/secondary_axis.py index 4fc3de442d3b..b326a858871c 100644 --- a/examples/subplots_axes_and_figures/secondary_axis.py +++ b/examples/subplots_axes_and_figures/secondary_axis.py @@ -183,14 +183,10 @@ def anomaly_to_celsius(x): ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions and methods is shown in this example: - -import matplotlib - -matplotlib.axes.Axes.secondary_xaxis -matplotlib.axes.Axes.secondary_yaxis +# - `matplotlib.axes.Axes.secondary_xaxis` +# - `matplotlib.axes.Axes.secondary_yaxis` diff --git a/examples/subplots_axes_and_figures/zoom_inset_axes.py b/examples/subplots_axes_and_figures/zoom_inset_axes.py index e4b630aa9356..e3f99ce3aec9 100644 --- a/examples/subplots_axes_and_figures/zoom_inset_axes.py +++ b/examples/subplots_axes_and_figures/zoom_inset_axes.py @@ -42,14 +42,11 @@ def get_demo_image(): ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions and methods is shown in this example: - -import matplotlib -matplotlib.axes.Axes.inset_axes -matplotlib.axes.Axes.indicate_inset_zoom -matplotlib.axes.Axes.imshow +# - `matplotlib.axes.Axes.inset_axes` +# - `matplotlib.axes.Axes.indicate_inset_zoom` +# - `matplotlib.axes.Axes.imshow` diff --git a/examples/text_labels_and_annotations/angle_annotation.py b/examples/text_labels_and_annotations/angle_annotation.py index d22501232ce2..065e4f51c9b8 100644 --- a/examples/text_labels_and_annotations/angle_annotation.py +++ b/examples/text_labels_and_annotations/angle_annotation.py @@ -58,7 +58,6 @@ import numpy as np -import matplotlib import matplotlib.pyplot as plt from matplotlib.patches import Arc from matplotlib.transforms import IdentityTransform, TransformedBbox, Bbox @@ -314,18 +313,14 @@ def plot_angle(ax, pos, angle, length=0.95, acol="C0", **kwargs): ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions, methods and classes is shown -# in this example: - -matplotlib.patches.Arc -matplotlib.axes.Axes.annotate -matplotlib.pyplot.annotate -matplotlib.text.Annotation -matplotlib.transforms.IdentityTransform -matplotlib.transforms.TransformedBbox -matplotlib.transforms.Bbox +# - `matplotlib.patches.Arc` +# - `matplotlib.axes.Axes.annotate` / `matplotlib.pyplot.annotate` +# - `matplotlib.text.Annotation` +# - `matplotlib.transforms.IdentityTransform` +# - `matplotlib.transforms.TransformedBbox` +# - `matplotlib.transforms.Bbox` diff --git a/examples/text_labels_and_annotations/demo_annotation_box.py b/examples/text_labels_and_annotations/demo_annotation_box.py index 51cf88d07b07..db808b543541 100644 --- a/examples/text_labels_and_annotations/demo_annotation_box.py +++ b/examples/text_labels_and_annotations/demo_annotation_box.py @@ -104,20 +104,16 @@ ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following functions, methods and classes is shown in this -# example: - -Circle -TextArea -DrawingArea -OffsetImage -AnnotationBbox -get_sample_data -plt.subplots -plt.imread -plt.show +# - `matplotlib.patches.Circle` +# - `matplotlib.offsetbox.TextArea` +# - `matplotlib.offsetbox.DrawingArea` +# - `matplotlib.offsetbox.OffsetImage` +# - `matplotlib.offsetbox.AnnotationBbox` +# - `matplotlib.cbook.get_sample_data` +# - `matplotlib.pyplot.subplots` +# - `matplotlib.pyplot.imread` diff --git a/examples/text_labels_and_annotations/demo_text_rotation_mode.py b/examples/text_labels_and_annotations/demo_text_rotation_mode.py index bbe1639706ed..ded20e8abe8d 100644 --- a/examples/text_labels_and_annotations/demo_text_rotation_mode.py +++ b/examples/text_labels_and_annotations/demo_text_rotation_mode.py @@ -78,12 +78,9 @@ def test_rotation_mode(fig, mode, subplot_location): ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The use of the following method is shown in this example: - -import matplotlib -matplotlib.axes.Axes.text +# - `matplotlib.axes.Axes.text` / `matplotlib.pyplot.text` diff --git a/examples/ticks_and_spines/date_precision_and_epochs.py b/examples/ticks_and_spines/date_precision_and_epochs.py index 9526adba55e7..54e6b2e26b12 100644 --- a/examples/ticks_and_spines/date_precision_and_epochs.py +++ b/examples/ticks_and_spines/date_precision_and_epochs.py @@ -20,7 +20,6 @@ import datetime import numpy as np -import matplotlib import matplotlib.pyplot as plt import matplotlib.dates as mdates @@ -147,14 +146,12 @@ def _reset_epoch_for_tutorial(): _reset_epoch_for_tutorial() # Don't do this. Just for this tutorial. ############################################################################# -# ------------ # -# References -# """""""""" +# .. admonition:: References # -# The use of the following functions, methods and classes is shown -# in this example: - -matplotlib.dates.num2date -matplotlib.dates.date2num -matplotlib.dates.set_epoch +# The use of the following functions, methods, classes and modules is shown +# in this example: +# +# - `matplotlib.dates.num2date` +# - `matplotlib.dates.date2num` +# - `matplotlib.dates.set_epoch` diff --git a/tutorials/intermediate/gridspec.py b/tutorials/intermediate/gridspec.py index 4debe8a9d43a..d1d469ac02b7 100644 --- a/tutorials/intermediate/gridspec.py +++ b/tutorials/intermediate/gridspec.py @@ -28,7 +28,6 @@ """ -import matplotlib import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec @@ -256,16 +255,14 @@ def squiggle_xy(a, b, c, d, i=np.arange(0.0, 2*np.pi, 0.05)): ############################################################################# # -# ------------ +# .. admonition:: References # -# References -# """""""""" +# The use of the following functions, methods, classes and modules is shown +# in this example: # -# The usage of the following functions and methods is shown in this example: - -matplotlib.pyplot.subplots -matplotlib.figure.Figure.add_gridspec -matplotlib.figure.Figure.add_subplot -matplotlib.gridspec.GridSpec -matplotlib.gridspec.SubplotSpec.subgridspec -matplotlib.gridspec.GridSpecFromSubplotSpec +# - `matplotlib.pyplot.subplots` +# - `matplotlib.figure.Figure.add_gridspec` +# - `matplotlib.figure.Figure.add_subplot` +# - `matplotlib.gridspec.GridSpec` +# - `matplotlib.gridspec.SubplotSpec.subgridspec` +# - `matplotlib.gridspec.GridSpecFromSubplotSpec`