Skip to content

Commit b2b3d1f

Browse files
willschlitzerseismanmichaelgrundweiji14core-man
authored
Reorganize gallery examples (#995)
Changes in this PR: - Reorganizes the gallery examples to have more specific categories - Sort gallery examples by "title" in each subsection - Use underscores in file and directory names Co-authored-by: Dongdong Tian <[email protected]> Co-authored-by: Michael Grund <[email protected]> Co-authored-by: Wei Ji <[email protected]> Co-authored-by: Yao Jiayuan <[email protected]> Co-authored-by: Meghan Jones <[email protected]>
1 parent 80b699d commit b2b3d1f

36 files changed

+27
-18
lines changed

doc/conf.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# isort: off
1010
from sphinx_gallery.sorting import ( # pylint: disable=no-name-in-module
1111
ExplicitOrder,
12-
FileNameSortKey,
12+
ExampleTitleSortKey,
1313
)
1414
from pygmt import __commit__, __version__
1515
from pygmt.sphinx_gallery import PyGMTScraper
@@ -71,10 +71,13 @@
7171
"gallery_dirs": ["gallery", "tutorials", "projections"],
7272
"subsection_order": ExplicitOrder(
7373
[
74-
"../examples/gallery/line",
75-
"../examples/gallery/coast",
76-
"../examples/gallery/plot",
77-
"../examples/gallery/grid",
74+
"../examples/gallery/maps",
75+
"../examples/gallery/lines",
76+
"../examples/gallery/symbols",
77+
"../examples/gallery/images",
78+
"../examples/gallery/3d_plots",
79+
"../examples/gallery/seismology",
80+
"../examples/gallery/embellishments",
7881
"../examples/projections/azim",
7982
"../examples/projections/conic",
8083
"../examples/projections/cyl",
@@ -88,7 +91,7 @@
8891
# Remove the "Download all examples" button from the top level gallery
8992
"download_all_examples": False,
9093
# Sort gallery example by file name instead of number of lines (default)
91-
"within_subsection_order": FileNameSortKey,
94+
"within_subsection_order": ExampleTitleSortKey,
9295
# directory where function granular galleries are stored
9396
"backreferences_dir": "api/generated/backreferences",
9497
# Modules for which function level galleries are created. In

doc/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
tutorials/contour-map.rst
3939
tutorials/earth-relief.rst
4040
tutorials/3d-perspective-image.rst
41-
tutorials/inset.rst
41+
tutorials/insets.rst
4242
tutorials/subplots.rst
4343
tutorials/configuration.rst
4444

examples/gallery/3d_plots/README.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
3D Plots
2+
--------

examples/gallery/coast/README.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Plot embellishments
2+
-------------------

examples/gallery/grid/README.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

examples/gallery/images/README.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Images, contours, and fields
2+
----------------------------
File renamed without changes.

examples/gallery/line/README.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

examples/gallery/lines/README.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Lines and vectors
2+
-----------------

examples/gallery/line/vector-heads-tails.py renamed to examples/gallery/lines/vector_heads_tails.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
In the following we use the :meth:`pygmt.Figure.plot` method to plot vectors
2727
with individual heads and tails. We must specify the modifiers (together with
2828
the vector type, here ``v``, see also
29-
:doc:`Vector types documentation </gallery/line/vectors>`)
29+
:doc:`Vector types documentation </gallery/lines/vectors>`)
3030
by passing the corresponding shortcuts to the ``style`` parameter.
3131
3232
"""

examples/gallery/line/vectors.py renamed to examples/gallery/lines/vectors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
The :meth:`pygmt.Figure.plot` method can plot Cartesian, circular, and geographic vectors.
66
The ``style`` parameter controls vector attributes. See also
7-
:doc:`Vector attributes documentation </gallery/line/vector-heads-tails>`.
7+
:doc:`Vector attributes documentation </gallery/lines/vector_heads_tails>`.
88
99
"""
1010
import numpy as np

examples/gallery/maps/README.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Maps and map elements
2+
---------------------
File renamed without changes.

examples/gallery/plot/README.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Seismology and geodesy
2+
----------------------
File renamed without changes.

examples/gallery/symbols/README.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Symbols and markers
2+
-------------------
File renamed without changes.
File renamed without changes.

examples/tutorials/lines.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
# example below, the line width is set to ``7p``, the color is set to ``green``, and the
126126
# line style is ``-.-`` (*dash dot dash*).
127127
#
128-
# For a gallery showing other ``pen`` settings, see :doc:`/gallery/line/linestyles`.
128+
# For a gallery showing other ``pen`` settings, see :doc:`/gallery/lines/linestyles`.
129129

130130
fig = pygmt.Figure()
131131
fig.plot(

0 commit comments

Comments
 (0)