diff --git a/.gitignore b/.gitignore index ef24f928c811..488d37aaa510 100644 --- a/.gitignore +++ b/.gitignore @@ -60,10 +60,11 @@ lib/matplotlib/mpl-data/matplotlibrc # sphinx build directory doc/_build doc/api/_as_gen -# autogenerated by sphinx-gallery -doc/examples -doc/gallery -doc/tutorials +# autogenerated by sphinx-exhibit +doc/gallery/* +!doc/gallery/index.rst +doc/tutorials/* +!doc/tutorials/index.rst doc/modules doc/pyplots/tex_demo.png lib/dateutil @@ -72,6 +73,7 @@ examples/*/*.pdf examples/*/*.png examples/*/*.svg examples/*/*.svgz +examples/*/*.mp4 examples/tests/* !examples/tests/backend_driver_sgskip.py result_images diff --git a/doc-requirements.txt b/doc-requirements.txt index c0ee2014cf64..521a41595056 100644 --- a/doc-requirements.txt +++ b/doc-requirements.txt @@ -13,3 +13,5 @@ ipywidgets numpydoc>=0.4 pillow sphinx-gallery>=0.1.13 +git+https://github.com/anntzer/sphinx-exhibit +sphinx-jinja>=1.1.0 diff --git a/doc/_templates/autosummary.rst b/doc/_templates/autosummary.rst index 80c7004c40c4..4e460af8971d 100644 --- a/doc/_templates/autosummary.rst +++ b/doc/_templates/autosummary.rst @@ -1,30 +1,10 @@ {{ fullname | escape | underline }} - .. currentmodule:: {{ module }} - -{% if objtype in ['class'] %} +{% if objtype == 'class' %} .. auto{{ objtype }}:: {{ objname }} - :show-inheritance: - + :show-inheritance: {% else %} .. auto{{ objtype }}:: {{ objname }} - -{% endif %} - -{% if objtype in ['class', 'method', 'function'] %} -{% if objname in ['AxesGrid', 'Scalable', 'HostAxes', 'FloatingAxes', - 'ParasiteAxesAuxTrans', 'ParasiteAxes'] %} -.. Filter out the above aliases to other classes, as sphinx gallery - creates no example file for those (sphinx-gallery/sphinx-gallery#365) - -{% else %} -.. include:: {{module}}.{{objname}}.examples - -.. raw:: html - -
- -{% endif %} {% endif %} diff --git a/doc/_templates/function.rst b/doc/_templates/function.rst index 4a7464080456..d8c9bd4807cc 100644 --- a/doc/_templates/function.rst +++ b/doc/_templates/function.rst @@ -5,8 +5,6 @@ .. autofunction:: {{ objname }} -.. include:: {{module}}.{{objname}}.examples - .. raw:: html -
\ No newline at end of file +
diff --git a/doc/conf.py b/doc/conf.py index 095ea340abd1..242bd5258dd4 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -36,7 +36,8 @@ 'IPython.sphinxext.ipython_console_highlighting', 'IPython.sphinxext.ipython_directive', 'numpydoc', # Needs to be loaded *after* autodoc. - 'sphinx_gallery.gen_gallery', + 'sphinx_exhibit', + 'sphinxcontrib.jinja', 'matplotlib.sphinxext.mathmpl', 'matplotlib.sphinxext.plot_directive', 'sphinxext.custom_roles', @@ -55,6 +56,7 @@ def _check_deps(): "matplotlib": 'matplotlib', "numpydoc": 'numpydoc', "PIL.Image": 'pillow', + "sphinx_exhibit": 'sphinx_exhibit', "sphinx_gallery": 'sphinx_gallery'} missing = [] for name in names: @@ -69,13 +71,6 @@ def _check_deps(): _check_deps() -# Import only after checking for dependencies. -# gallery_order.py from the sphinxext folder provides the classes that -# allow custom ordering of sections and subsections of the gallery -import sphinxext.gallery_order as gallery_order -# The following import is only necessary to monkey patch the signature later on -from sphinx_gallery import gen_rst - if shutil.which('dot') is None: raise OSError( "No binary named dot - you need to install the Graph Visualization " @@ -94,36 +89,6 @@ def _check_deps(): 'cycler': ('https://matplotlib.org/cycler', None), } - -# Sphinx gallery configuration -sphinx_gallery_conf = { - 'examples_dirs': ['../examples', '../tutorials'], - 'filename_pattern': '^((?!sgskip).)*$', - 'gallery_dirs': ['gallery', 'tutorials'], - 'doc_module': ('matplotlib', 'mpl_toolkits'), - 'reference_url': { - 'matplotlib': None, - 'numpy': 'https://docs.scipy.org/doc/numpy', - 'scipy': 'https://docs.scipy.org/doc/scipy/reference', - }, - 'backreferences_dir': 'api/_as_gen', - 'subsection_order': gallery_order.sectionorder, - 'within_subsection_order': gallery_order.subsectionorder, - 'min_reported_time': 1, -} - -plot_gallery = 'True' - -# Monkey-patching gallery signature to include search keywords -gen_rst.SPHX_GLR_SIG = """\n -.. only:: html - - .. rst-class:: sphx-glr-signature - - Keywords: matplotlib code example, codex, python plot, pyplot - `Gallery generated by Sphinx-Gallery - `_\n""" - # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -325,3 +290,46 @@ def _check_deps(): # numpydoc config numpydoc_show_class_members = False + +# Other configs. + +from pathlib import Path +jinja_contexts = { + "default": { + "examples": sorted( + dirpath.name + for dirpath in (Path(__file__).parent / "../examples").iterdir() + if (dirpath / "README.txt").exists() and dirpath.name not in [ + "lines_bars_and_markers", + "images_contours_and_fields", + "subplots_axes_and_figures", + "statistics", + "pie_and_polar_charts", + "text_labels_and_annotations", + "pyplots", + "color", + "shapes_and_collections", + "style_sheets", + "axes_grid1", + "axisartist", + "showcase", + ] + ) + }, +} + +exhibit_syntax_style = "sphinx-gallery" +exhibit_output_style = "sphinx-gallery" + + +def autodoc_process_docstring(app, what, name, obj, options, lines): + lines.extend([ + "", + ".. exhibit-backrefs:: py:{} {}".format(what, name), + " :title: The following examples showcase the use of :py:obj:`{}`:" + .format(name)]) + + +def setup(app): + app.setup_extension("sphinx.ext.autodoc") + app.connect("autodoc-process-docstring", autodoc_process_docstring) diff --git a/doc/contents.rst b/doc/contents.rst index 8102de243339..9865da055035 100644 --- a/doc/contents.rst +++ b/doc/contents.rst @@ -1,5 +1,3 @@ - - Overview ======== @@ -10,7 +8,6 @@ Overview Download `PDF `_ - .. toctree:: :maxdepth: 2 @@ -22,6 +19,12 @@ Overview devel/index.rst glossary/index.rst +.. toctree:: + :hidden: + + gallery/index + tutorials/index + .. only:: html * :ref:`genindex` diff --git a/doc/gallery/index.rst b/doc/gallery/index.rst new file mode 100644 index 000000000000..8b152b33f78c --- /dev/null +++ b/doc/gallery/index.rst @@ -0,0 +1,106 @@ +.. include:: ../../examples/README.txt + +.. include:: ../../examples/lines_bars_and_markers/README.txt + +.. exhibit:: + :srcdir: ../../examples + + lines_bars_and_markers/*.py + +.. include:: ../../examples/images_contours_and_fields/README.txt + +.. exhibit:: + :srcdir: ../../examples + + images_contours_and_fields/*.py + +.. include:: ../../examples/subplots_axes_and_figures/README.txt + +.. exhibit:: + :srcdir: ../../examples + + subplots_axes_and_figures/*.py + +.. include:: ../../examples/statistics/README.txt + +.. exhibit:: + :srcdir: ../../examples + + statistics/*.py + +.. include:: ../../examples/pie_and_polar_charts/README.txt + +.. exhibit:: + :srcdir: ../../examples + + pie_features.py + pie_demo2.py + pie_and_polar_charts/*.py + +.. include:: ../../examples/text_labels_and_annotations/README.txt + +.. exhibit:: + :srcdir: ../../examples + + text_labels_and_annotations/*.py + +.. include:: ../../examples/pyplots/README.txt + +.. exhibit:: + :srcdir: ../../examples + + pyplots/*.py + +.. include:: ../../examples/color/README.txt + +.. exhibit:: + :srcdir: ../../examples + + color/color_demo.py + color/*.py + +.. include:: ../../examples/shapes_and_collections/README.txt + +.. exhibit:: + :srcdir: ../../examples + + shapes_and_collections/*.py + +.. include:: ../../examples/style_sheets/README.txt + +.. exhibit:: + :srcdir: ../../examples + + style_sheets/*.py + +.. include:: ../../examples/axes_grid1/README.txt + +.. exhibit:: + :srcdir: ../../examples + + axes_grid1/*.py + +.. include:: ../../examples/axisartist/README.txt + +.. exhibit:: + :srcdir: ../../examples + + axisartist/*.py + +.. include:: ../../examples/showcase/README.txt + +.. exhibit:: + :srcdir: ../../examples + + showcase/*.py + +.. jinja:: default + + {% for subdir in examples %} + .. include:: ../../examples/{{ subdir }}/README.txt + + .. exhibit:: + :srcdir: ../../examples + + {{ subdir }}/*.py + {% endfor %} diff --git a/doc/sphinxext/gallery_order.py b/doc/sphinxext/gallery_order.py deleted file mode 100644 index 9229ea7ef97e..000000000000 --- a/doc/sphinxext/gallery_order.py +++ /dev/null @@ -1,85 +0,0 @@ -""" -Configuration for the order of gallery sections and examples. -Paths are relative to the conf.py file. - -""" - -from sphinx_gallery.sorting import ExplicitOrder - -# Gallery sections shall be diplayed in the following order. -# Non-matching sections are appended. -explicit_order_folders = [ - '../examples/lines_bars_and_markers', - '../examples/images_contours_and_fields', - '../examples/subplots_axes_and_figures', - '../examples/statistics', - '../examples/pie_and_polar_charts', - '../examples/text_labels_and_annotations', - '../examples/pyplots', - '../examples/color', - '../examples/shapes_and_collections', - '../examples/style_sheets', - '../examples/axes_grid1', - '../examples/axisartist', - '../examples/showcase', - '../tutorials/introductory', - '../tutorials/intermediate', - '../tutorials/advanced'] - - -class MplExplicitOrder(ExplicitOrder): - """ for use within the 'subsection_order' key""" - def __call__(self, item): - """Return a string determining the sort order.""" - if item in self.ordered_list: - return "{:04d}".format(self.ordered_list.index(item)) - else: - # ensure not explicitly listed items come last. - return "zzz" + item - - -# Subsection order: -# Subsections are ordered by filename, unless they appear in the following -# lists in which case the list order determines the order within the section. -# Examples/tutorials that do not appear in a list will be appended. - -list_all = [ - # **Tutorials** - # introductory - "usage", "pyplot", "sample_plots", "images", "lifecycle", "customizing", - # intermediate - "artists", "legend_guide", "color_cycle", "gridspec", - "constrainedlayout_guide", "tight_layout_guide", - # advanced - # text - "text_intro", "text_props", - # colors - "colors", - - # **Examples** - # color - "color_demo", - # pies - "pie_features", "pie_demo2", - ] -explicit_subsection_order = [item + ".py" for item in list_all] - - -class MplExplicitSubOrder(object): - """ for use within the 'within_subsection_order' key """ - def __init__(self, src_dir): - self.src_dir = src_dir # src_dir is unused here - self.ordered_list = explicit_subsection_order - - def __call__(self, item): - """Return a string determining the sort order.""" - if item in self.ordered_list: - return "{:04d}".format(self.ordered_list.index(item)) - else: - # ensure not explicitly listed items come last. - return "zzz" + item - - -# Provide the above classes for use in conf.py -sectionorder = MplExplicitOrder(explicit_order_folders) -subsectionorder = MplExplicitSubOrder diff --git a/doc/tutorials/index.rst b/doc/tutorials/index.rst new file mode 100644 index 000000000000..189dcad3a8ac --- /dev/null +++ b/doc/tutorials/index.rst @@ -0,0 +1,56 @@ +.. include:: ../../tutorials/README.txt + +.. include:: ../../tutorials/introductory/README.txt + +.. exhibit:: + :srcdir: ../../tutorials + + introductory/usage.py + introductory/pyplot.py + introductory/sample_plots.py + introductory/images.py + introductory/lifecycle.py + introductory/customizing.py + introductory/*.py + +.. include:: ../../tutorials/intermediate/README.txt + +.. exhibit:: + :srcdir: ../../tutorials + + intermediate/artists.py + intermediate/legend_guide.py + intermediate/color_cycle.py + intermediate/gridspec.py + intermediate/constrainedlayout_guide.py + intermediate/tight_layout_guide.py + intermediate/*.py + +.. include:: ../../tutorials/advanced/README.txt + +.. exhibit:: + :srcdir: ../../tutorials + + advanced/*.py + +.. include:: ../../tutorials/colors/README.txt + +.. exhibit:: + :srcdir: ../../tutorials + + colors/colors.py + colors/*.py + +.. include:: ../../tutorials/text/README.txt + +.. exhibit:: + :srcdir: ../../tutorials + + text/*.py + +.. include:: ../../tutorials/toolkits/README.txt + +.. exhibit:: + :srcdir: ../../tutorials + + toolkits/*.py diff --git a/examples/animation/double_pendulum_sgskip.py b/examples/animation/double_pendulum_sgskip.py index 3d4bf0c618ca..c0ee614d4b08 100644 --- a/examples/animation/double_pendulum_sgskip.py +++ b/examples/animation/double_pendulum_sgskip.py @@ -7,6 +7,8 @@ Double pendulum formula translated from the C code at http://www.physics.usyd.edu.au/~wheat/dpend_html/solve_dpend.c + +.. exhibit-skip:: """ from numpy import sin, cos diff --git a/examples/animation/frame_grabbing_sgskip.py b/examples/animation/frame_grabbing_sgskip.py index e74576249aa0..594bbb0682d6 100644 --- a/examples/animation/frame_grabbing_sgskip.py +++ b/examples/animation/frame_grabbing_sgskip.py @@ -6,6 +6,8 @@ Use a MovieWriter directly to grab individual frames and write them to a file. This avoids any event loop integration, and thus works even with the Agg backend. This is not recommended for use in an interactive setting. + +.. exhibit-skip:: """ import numpy as np diff --git a/examples/event_handling/ginput_manual_clabel_sgskip.py b/examples/event_handling/ginput_manual_clabel_sgskip.py index e29a946e6dea..0975753e0c70 100644 --- a/examples/event_handling/ginput_manual_clabel_sgskip.py +++ b/examples/event_handling/ginput_manual_clabel_sgskip.py @@ -10,6 +10,7 @@ graphical user interface (for example, using GTK3Agg backend, but not PS backend). +.. exhibit-skip:: """ import time diff --git a/examples/event_handling/pong_sgskip.py b/examples/event_handling/pong_sgskip.py index e25153e826a7..74cece98a270 100644 --- a/examples/event_handling/pong_sgskip.py +++ b/examples/event_handling/pong_sgskip.py @@ -9,6 +9,7 @@ This example requires :download:`pipong.py ` +.. exhibit-skip:: """ import time diff --git a/examples/misc/cursor_demo_sgskip.py b/examples/misc/cursor_demo_sgskip.py index 7354b4bb0735..6449c9b0a27a 100644 --- a/examples/misc/cursor_demo_sgskip.py +++ b/examples/misc/cursor_demo_sgskip.py @@ -15,6 +15,8 @@ https://github.com/joferkington/mpldatacursor https://github.com/anntzer/mplcursors + +.. exhibit-skip:: """ import matplotlib.pyplot as plt import numpy as np diff --git a/examples/misc/hyperlinks_sgskip.py b/examples/misc/hyperlinks_sgskip.py index 5298d45cdc0e..d956323a27bc 100644 --- a/examples/misc/hyperlinks_sgskip.py +++ b/examples/misc/hyperlinks_sgskip.py @@ -7,6 +7,7 @@ This currently only works with the SVG backend. +.. exhibit-skip:: """ diff --git a/examples/misc/image_thumbnail_sgskip.py b/examples/misc/image_thumbnail_sgskip.py index ae82e616743b..c8a27f37fbcd 100644 --- a/examples/misc/image_thumbnail_sgskip.py +++ b/examples/misc/image_thumbnail_sgskip.py @@ -7,7 +7,7 @@ matplotlib natively supports PNG files on the input side, and other image types transparently if your have PIL installed - +.. exhibit-skip:: """ # build thumbnails of all images in a directory diff --git a/examples/misc/multiprocess_sgskip.py b/examples/misc/multiprocess_sgskip.py index 517fdc392556..be45f0281b12 100644 --- a/examples/misc/multiprocess_sgskip.py +++ b/examples/misc/multiprocess_sgskip.py @@ -7,6 +7,8 @@ plotting in another. Written by Robert Cimrman + +.. exhibit-skip:: """ import multiprocessing as mp diff --git a/examples/misc/print_stdout_sgskip.py b/examples/misc/print_stdout_sgskip.py index 69b0b33616d8..51c3402fef97 100644 --- a/examples/misc/print_stdout_sgskip.py +++ b/examples/misc/print_stdout_sgskip.py @@ -7,6 +7,7 @@ usage: python print_stdout.py > somefile.png +.. exhibit-skip:: """ import sys diff --git a/examples/mplot3d/rotate_axes3d_sgskip.py b/examples/mplot3d/rotate_axes3d_sgskip.py index 666bb68f6cd7..03bca05c6729 100644 --- a/examples/mplot3d/rotate_axes3d_sgskip.py +++ b/examples/mplot3d/rotate_axes3d_sgskip.py @@ -9,6 +9,8 @@ (This example is skipped when building the documentation gallery because it intentionally takes a long time to run) + +.. exhibit-skip:: ''' from mpl_toolkits.mplot3d import axes3d diff --git a/examples/mplot3d/wire3d_animation_sgskip.py b/examples/mplot3d/wire3d_animation_sgskip.py index 4e727817264c..386a50342e1b 100644 --- a/examples/mplot3d/wire3d_animation_sgskip.py +++ b/examples/mplot3d/wire3d_animation_sgskip.py @@ -7,6 +7,8 @@ (This example is skipped when building the documentation gallery because it intentionally takes a long time to run) + +.. exhibit-skip:: """ diff --git a/examples/text_labels_and_annotations/font_family_rc_sgskip.py b/examples/text_labels_and_annotations/font_family_rc_sgskip.py index 8cb4b620cfad..fee4b32fed11 100644 --- a/examples/text_labels_and_annotations/font_family_rc_sgskip.py +++ b/examples/text_labels_and_annotations/font_family_rc_sgskip.py @@ -18,6 +18,7 @@ rcParams['font.sans-serif'] = ['Tahoma', 'DejaVu Sans', 'Lucida Grande', 'Verdana'] +.. exhibit-skip:: """ diff --git a/examples/text_labels_and_annotations/font_table_ttf_sgskip.py b/examples/text_labels_and_annotations/font_table_ttf_sgskip.py index 6de73e68dea3..ccc9d4706205 100644 --- a/examples/text_labels_and_annotations/font_table_ttf_sgskip.py +++ b/examples/text_labels_and_annotations/font_table_ttf_sgskip.py @@ -9,6 +9,7 @@ Usage python font_table_ttf.py somefile.ttf +.. exhibit-skip:: """ import sys diff --git a/examples/user_interfaces/embedding_in_gtk3_panzoom_sgskip.py b/examples/user_interfaces/embedding_in_gtk3_panzoom_sgskip.py index 7dfd1a5c56d5..70e32e81d17f 100644 --- a/examples/user_interfaces/embedding_in_gtk3_panzoom_sgskip.py +++ b/examples/user_interfaces/embedding_in_gtk3_panzoom_sgskip.py @@ -4,6 +4,8 @@ ========================= Demonstrate NavigationToolbar with GTK3 accessed via pygobject. + +.. exhibit-skip:: """ import gi diff --git a/examples/user_interfaces/embedding_in_gtk3_sgskip.py b/examples/user_interfaces/embedding_in_gtk3_sgskip.py index af76a0d724f2..b38860de6ba0 100644 --- a/examples/user_interfaces/embedding_in_gtk3_sgskip.py +++ b/examples/user_interfaces/embedding_in_gtk3_sgskip.py @@ -5,6 +5,8 @@ Demonstrate adding a FigureCanvasGTK3Agg widget to a Gtk.ScrolledWindow using GTK3 accessed via pygobject. + +.. exhibit-skip:: """ import gi diff --git a/examples/user_interfaces/embedding_in_qt_sgskip.py b/examples/user_interfaces/embedding_in_qt_sgskip.py index 54059c62147b..d504eee1ffcc 100644 --- a/examples/user_interfaces/embedding_in_qt_sgskip.py +++ b/examples/user_interfaces/embedding_in_qt_sgskip.py @@ -7,6 +7,8 @@ equally well using Qt4 and Qt5. Either version of Qt can be selected (for example) by setting the ``MPLBACKEND`` environment variable to "Qt4Agg" or "Qt5Agg", or by first importing the desired version of PyQt. + +.. exhibit-skip:: """ import sys diff --git a/examples/user_interfaces/embedding_in_tk_sgskip.py b/examples/user_interfaces/embedding_in_tk_sgskip.py index 7d32c6a7cffb..15b3d2f036dc 100644 --- a/examples/user_interfaces/embedding_in_tk_sgskip.py +++ b/examples/user_interfaces/embedding_in_tk_sgskip.py @@ -3,6 +3,7 @@ Embedding In Tk =============== +.. exhibit-skip:: """ import tkinter diff --git a/examples/user_interfaces/embedding_in_wx2_sgskip.py b/examples/user_interfaces/embedding_in_wx2_sgskip.py index 895627733f43..00b6939d554b 100644 --- a/examples/user_interfaces/embedding_in_wx2_sgskip.py +++ b/examples/user_interfaces/embedding_in_wx2_sgskip.py @@ -5,6 +5,8 @@ An example of how to use wxagg in an application with the new toolbar - comment out the add_toolbar line for no toolbar + +.. exhibit-skip:: """ from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas diff --git a/examples/user_interfaces/embedding_in_wx3_sgskip.py b/examples/user_interfaces/embedding_in_wx3_sgskip.py index fcb69f0a910b..63750bd8b3b8 100644 --- a/examples/user_interfaces/embedding_in_wx3_sgskip.py +++ b/examples/user_interfaces/embedding_in_wx3_sgskip.py @@ -19,6 +19,8 @@ This was derived from embedding_in_wx and dynamic_image_wxagg. Thanks to matplotlib and wx teams for creating such great software! + +.. exhibit-skip:: """ import matplotlib diff --git a/examples/user_interfaces/embedding_in_wx4_sgskip.py b/examples/user_interfaces/embedding_in_wx4_sgskip.py index c984e02b06da..53385f5e0662 100644 --- a/examples/user_interfaces/embedding_in_wx4_sgskip.py +++ b/examples/user_interfaces/embedding_in_wx4_sgskip.py @@ -4,6 +4,8 @@ ================ An example of how to use wx or wxagg in an application with a custom toolbar. + +.. exhibit-skip:: """ from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas diff --git a/examples/user_interfaces/embedding_in_wx5_sgskip.py b/examples/user_interfaces/embedding_in_wx5_sgskip.py index c726a988fd89..bd9d61efb450 100644 --- a/examples/user_interfaces/embedding_in_wx5_sgskip.py +++ b/examples/user_interfaces/embedding_in_wx5_sgskip.py @@ -3,6 +3,7 @@ Embedding In Wx5 ================ +.. exhibit-skip:: """ import wx diff --git a/examples/user_interfaces/embedding_webagg_sgskip.py b/examples/user_interfaces/embedding_webagg_sgskip.py index 9dd164c53147..78b837469c3b 100644 --- a/examples/user_interfaces/embedding_webagg_sgskip.py +++ b/examples/user_interfaces/embedding_webagg_sgskip.py @@ -10,6 +10,8 @@ side". The framework being used must support web sockets. + +.. exhibit-skip:: """ import io diff --git a/examples/user_interfaces/fourier_demo_wx_sgskip.py b/examples/user_interfaces/fourier_demo_wx_sgskip.py index b00cd01d6982..02f0bf264434 100644 --- a/examples/user_interfaces/fourier_demo_wx_sgskip.py +++ b/examples/user_interfaces/fourier_demo_wx_sgskip.py @@ -3,6 +3,7 @@ Fourier Demo WX =============== +.. exhibit-skip:: """ import numpy as np diff --git a/examples/user_interfaces/gtk_spreadsheet_sgskip.py b/examples/user_interfaces/gtk_spreadsheet_sgskip.py index 476022db1c44..ebbd02381f78 100644 --- a/examples/user_interfaces/gtk_spreadsheet_sgskip.py +++ b/examples/user_interfaces/gtk_spreadsheet_sgskip.py @@ -7,6 +7,7 @@ a treeview to store data. Double click on an entry to update plot data +.. exhibit-skip:: """ import gi gi.require_version('Gtk', '3.0') diff --git a/examples/user_interfaces/mathtext_wx_sgskip.py b/examples/user_interfaces/mathtext_wx_sgskip.py index 53a861986c23..026b0b113334 100644 --- a/examples/user_interfaces/mathtext_wx_sgskip.py +++ b/examples/user_interfaces/mathtext_wx_sgskip.py @@ -5,6 +5,8 @@ Demonstrates how to convert mathtext to a wx.Bitmap for display in various controls on wxPython. + +.. exhibit-skip:: """ import matplotlib diff --git a/examples/user_interfaces/mpl_with_glade3_sgskip.py b/examples/user_interfaces/mpl_with_glade3_sgskip.py index 3329bc342da9..f0d16bb8db67 100644 --- a/examples/user_interfaces/mpl_with_glade3_sgskip.py +++ b/examples/user_interfaces/mpl_with_glade3_sgskip.py @@ -3,6 +3,7 @@ Matplotlib With Glade 3 ======================= +.. exhibit-skip:: """ import os diff --git a/examples/user_interfaces/pylab_with_gtk_sgskip.py b/examples/user_interfaces/pylab_with_gtk_sgskip.py index 093105f1bd46..ed773d39c764 100644 --- a/examples/user_interfaces/pylab_with_gtk_sgskip.py +++ b/examples/user_interfaces/pylab_with_gtk_sgskip.py @@ -5,6 +5,8 @@ An example of how to use pyplot to manage your figure windows, but modify the GUI by accessing the underlying gtk widgets + +.. exhibit-skip:: """ import matplotlib matplotlib.use('GTK3Agg') # or 'GTK3Cairo' diff --git a/examples/user_interfaces/svg_histogram_sgskip.py b/examples/user_interfaces/svg_histogram_sgskip.py index 3791fe1ae939..08f0be531659 100644 --- a/examples/user_interfaces/svg_histogram_sgskip.py +++ b/examples/user_interfaces/svg_histogram_sgskip.py @@ -31,6 +31,7 @@ Author: david.huard@gmail.com +.. exhibit-skip:: """ diff --git a/examples/user_interfaces/svg_tooltip_sgskip.py b/examples/user_interfaces/svg_tooltip_sgskip.py index 815ce269a9fb..708883d18e16 100644 --- a/examples/user_interfaces/svg_tooltip_sgskip.py +++ b/examples/user_interfaces/svg_tooltip_sgskip.py @@ -20,6 +20,8 @@ :author: David Huard + +.. exhibit-skip:: """ diff --git a/examples/user_interfaces/toolmanager_sgskip.py b/examples/user_interfaces/toolmanager_sgskip.py index f1fd7c6146bc..7489632e6d05 100644 --- a/examples/user_interfaces/toolmanager_sgskip.py +++ b/examples/user_interfaces/toolmanager_sgskip.py @@ -11,6 +11,8 @@ * Remove tools Using `matplotlib.backend_managers.ToolManager` + +.. exhibit-skip:: """ import matplotlib.pyplot as plt diff --git a/examples/user_interfaces/wxcursor_demo_sgskip.py b/examples/user_interfaces/wxcursor_demo_sgskip.py index e74cf3e11f6e..c1c4801a3449 100644 --- a/examples/user_interfaces/wxcursor_demo_sgskip.py +++ b/examples/user_interfaces/wxcursor_demo_sgskip.py @@ -4,6 +4,8 @@ ============= Example to draw a cursor and report the data coords in wx. + +.. exhibit-skip:: """ diff --git a/examples/userdemo/pgf_preamble_sgskip.py b/examples/userdemo/pgf_preamble_sgskip.py index eccdefa0d6e1..5e6e593582a5 100644 --- a/examples/userdemo/pgf_preamble_sgskip.py +++ b/examples/userdemo/pgf_preamble_sgskip.py @@ -3,6 +3,7 @@ Pgf Preamble ============ +.. exhibit-skip:: """ import matplotlib as mpl diff --git a/examples/widgets/lasso_selector_demo_sgskip.py b/examples/widgets/lasso_selector_demo_sgskip.py index ac6c7325199f..986c30d00da3 100644 --- a/examples/widgets/lasso_selector_demo_sgskip.py +++ b/examples/widgets/lasso_selector_demo_sgskip.py @@ -8,6 +8,8 @@ This examples plots a scatter plot. You can then select a few points by drawing a lasso loop around the points on the graph. To draw, just click on the graph, hold, and drag it around the points you need to select. + +.. exhibit-skip:: """