X Tutup
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ def autodoc_process_bases(app, name, obj, options, bases):

sphinx_gallery_conf = {
'backreferences_dir': Path('api', '_as_gen'),
'minigallery_sort_order': 'sphinxext.gallery_order.preserve_order',
# Compression is a significant effort that we skip for local and CI builds.
'compress_images': ('thumbnails', 'images') if is_release_build else (),
'doc_module': ('matplotlib', 'mpl_toolkits'),
Expand Down
8 changes: 8 additions & 0 deletions doc/sphinxext/gallery_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Paths are relative to the conf.py file.
"""

import itertools
from sphinx_gallery.sorting import ExplicitOrder

# Gallery sections shall be displayed in the following order.
Expand Down Expand Up @@ -125,3 +126,10 @@ def __call__(self, item):
# Provide the above classes for use in conf.py
sectionorder = MplExplicitOrder(explicit_order_folders)
subsectionorder = MplExplicitSubOrder

_preserve_count = itertools.count()


def preserve_order(item):
"""A sorting key to preserve the original order of items in minigalleries."""
return next(_preserve_count)
125 changes: 19 additions & 106 deletions galleries/tutorials/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,124 +9,37 @@ For shorter examples, see our :ref:`examples page <examples-index>`.
You can also find :ref:`external resources <resources-index>` and
a :ref:`FAQ <howto-faq>` in our :ref:`user guide <users-guide-index>`.

Introductory
------------

.. raw:: html

<div class="sphx-glr-thumbnails">


.. raw:: html

<div class="sphx-glr-thumbcontainer" tooltip="An introduction to the pyplot interface. Please also see quick_start for an overview of how Ma...">

.. only:: html

.. image:: /tutorials/images/thumb/sphx_glr_pyplot_thumb.png
:alt: Pyplot tutorial

:ref:`sphx_glr_tutorials_pyplot.py`

.. raw:: html

<div class="sphx-glr-thumbnail-title">Pyplot tutorial</div>
</div>


.. raw:: html

<div class="sphx-glr-thumbcontainer" tooltip="Coding shortcuts">

.. only:: html

.. image:: /tutorials/images/thumb/sphx_glr_coding_shortcuts_thumb.png
:alt: Coding shortcuts

:ref:`sphx_glr_tutorials_coding_shortcuts.py`

.. raw:: html

<div class="sphx-glr-thumbnail-title">Coding shortcuts</div>
</div>


.. raw:: html

<div class="sphx-glr-thumbcontainer" tooltip="A short tutorial on plotting images with Matplotlib.">

.. only:: html

.. image:: /tutorials/images/thumb/sphx_glr_images_thumb.png
:alt: Image tutorial

:ref:`sphx_glr_tutorials_images.py`

.. raw:: html

<div class="sphx-glr-thumbnail-title">Image tutorial</div>
</div>


.. raw:: html

<div class="sphx-glr-thumbcontainer" tooltip="This tutorial aims to show the beginning, middle, and end of a single visualization using Matpl...">

.. only:: html

.. image:: /tutorials/images/thumb/sphx_glr_lifecycle_thumb.png
:alt: The Lifecycle of a Plot

:ref:`sphx_glr_tutorials_lifecycle.py`

.. raw:: html

<div class="sphx-glr-thumbnail-title">The Lifecycle of a Plot</div>
</div>


.. raw:: html

<div class="sphx-glr-thumbcontainer" tooltip="Using Artist objects to render on the canvas.">

.. only:: html

.. image:: /tutorials/images/thumb/sphx_glr_artists_thumb.png
:alt: Artist tutorial
.. minigallery::

:ref:`sphx_glr_tutorials_artists.py`
../galleries/tutorials/pyplot.py
../galleries/tutorials/coding_shortcuts.py
../galleries/tutorials/images.py

.. raw:: html
Intermediate
------------

<div class="sphx-glr-thumbnail-title">Artist tutorial</div>
</div>
.. minigallery::

../galleries/tutorials/lifecycle.py

.. raw:: html
Advanced
--------

</div>
.. minigallery::

../galleries/tutorials/artists.py

.. toctree::
:hidden:

/tutorials/pyplot
/tutorials/coding_shortcuts
/tutorials/images
/tutorials/lifecycle
/tutorials/artists

.. only:: html

.. container:: sphx-glr-footer sphx-glr-footer-gallery

.. container:: sphx-glr-download sphx-glr-download-python

:download:`Download all examples in Python source code: tutorials_python.zip </tutorials/tutorials_python.zip>`

.. container:: sphx-glr-download sphx-glr-download-jupyter

:download:`Download all examples in Jupyter notebooks: tutorials_jupyter.zip </tutorials/tutorials_jupyter.zip>`


pyplot
coding_shortcuts
images
lifecycle
artists

.. _user_guide_tutorials:

Expand Down
Loading
X Tutup