Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
b0c847b
Update code block separator in example 'timestamp.py'
yvonnefroehlich Sep 4, 2023
f8967c3
Update code block separator in example 'rgb_image.py'
yvonnefroehlich Sep 4, 2023
95f4b64
Update code block separator in example 'quoted_lines.py'
yvonnefroehlich Sep 4, 2023
52ceba7
Update code block separator in example 'country_polygons.py'
yvonnefroehlich Sep 4, 2023
216b25a
Update code block separator in example 'tilemaps.py'
yvonnefroehlich Sep 4, 2023
ff4405a
Update code block separator in example 'multi_parameter_symbols.py'
yvonnefroehlich Sep 4, 2023
0ddc58a
Update code block separator in intro '01_first_figure.py'
yvonnefroehlich Sep 4, 2023
4cf0c8e
Update code block separator in intro '02_contour_map.py'
yvonnefroehlich Sep 4, 2023
2a3e9b0
Update code block separator in tutorial 'coastlines.py'
yvonnefroehlich Sep 4, 2023
22ce481
Update code block separator in tutorial 'frames.py'
yvonnefroehlich Sep 4, 2023
b97760c
Update code block separator in tutorial 'lines.py'
yvonnefroehlich Sep 4, 2023
a20980f
Update code block separator in tutorial 'plot.py'
yvonnefroehlich Sep 4, 2023
0dee6d9
Update code block separator in tutorial 'regions.py'
yvonnefroehlich Sep 4, 2023
56e1f91
Update code block separator in tutorial 'text.py'
yvonnefroehlich Sep 4, 2023
b09e0fd
Update code block separator in tutorial 'insets.py'
yvonnefroehlich Sep 4, 2023
b6c1e3a
Update code block separator in tutorial 'vectors.py'
yvonnefroehlich Sep 4, 2023
9e98491
Update code block separator in tutorial 'cartesian_histograms.py'
yvonnefroehlich Sep 4, 2023
03fbd7e
Update code block separator in tutorial 'working_with_panel.py'
yvonnefroehlich Sep 4, 2023
af43904
Update code block separator in tutorial 'date_time_charts.py'
yvonnefroehlich Sep 4, 2023
a366801
Update code block separator in tutorial 'contour_map.py'
yvonnefroehlich Sep 4, 2023
1818644
Update code block separator in tutorial '3d_perspective_image.py'
yvonnefroehlich Sep 4, 2023
bc1991e
Update code block separator in tutorial 'earth_relief.py'
yvonnefroehlich Sep 4, 2023
d33671b
Update code block separator in tutorial 'configuration.py'
yvonnefroehlich Sep 4, 2023
39d9d75
Update code block separator in tutorial 'grid_equalization.py'
yvonnefroehlich Sep 4, 2023
c11feb2
Update code block separator in tutorial 'subplots.py'
yvonnefroehlich Sep 4, 2023
4544663
Use two empty lines before subsections
yvonnefroehlich Sep 4, 2023
4f694ac
[format-command] fixes
actions-bot Sep 4, 2023
c06f8ef
Merge branch 'main' into update-codeblock-separators
yvonnefroehlich Sep 6, 2023
b9452cf
Use '# %%' also at the beginning of the code
yvonnefroehlich Sep 6, 2023
0979bcd
Use '# %%' also at the beginning of the code for the projections
yvonnefroehlich Sep 7, 2023
91b1f0d
Update code block separator in 'contry_polygons.py' and 'frames.py'
yvonnefroehlich Sep 7, 2023
f0d719d
Merge branch 'main' into update-codeblock-separators
yvonnefroehlich Sep 7, 2023
3b7fa73
[format-command] fixes
actions-bot Sep 7, 2023
f263161
Merge branch 'main' into update-codeblock-separators
yvonnefroehlich Sep 7, 2023
d375ec5
Use 'correct' order in case 'sphinx_gallery_thumbnail_number' is used
yvonnefroehlich Sep 7, 2023
c2bf93e
Remove blank line
yvonnefroehlich Sep 8, 2023
ed85e0a
Add blank lines
yvonnefroehlich Sep 8, 2023
2a9c466
Move 'sphinx_gallery_thumbnail_number' to the end of the script
yvonnefroehlich Sep 9, 2023
d3d5b3b
Move 'sphinx_gallery_thumbnail_number' to the end of the script in ga…
yvonnefroehlich Sep 9, 2023
d24a45c
Move 'sphinx_gallery_thumbnail_number' to the end of the script in ga…
yvonnefroehlich Sep 9, 2023
de695a1
Update codeblock separator in 'azim' projections
yvonnefroehlich Sep 9, 2023
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 examples/gallery/3d_plots/grdview_surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
here we choose an azimuth of 45° with ``shading="+a45"``.
"""

# %%
import numpy as np
import pygmt
import xarray as xr
Expand Down
1 change: 1 addition & 0 deletions examples/gallery/3d_plots/scatter3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
the vertical exaggeration factor.
"""

# %%
import pandas as pd
import pygmt

Expand Down
1 change: 1 addition & 0 deletions examples/gallery/basemaps/double_y_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class can control which axes should be plotted and optionally show annotations,
x-axis limits, but different y-axis limits.
"""

# %%
import numpy as np
import pygmt

Expand Down
1 change: 1 addition & 0 deletions examples/gallery/basemaps/ternary.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
sample dataset via ``cmap=True``.
"""

# %%
import pygmt

fig = pygmt.Figure()
Expand Down
1 change: 1 addition & 0 deletions examples/gallery/embellishments/colorbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
to ``position`` to get a horizontal colorbar instead of a vertical one.
"""

# %%
import pygmt

fig = pygmt.Figure()
Expand Down
2 changes: 2 additions & 0 deletions examples/gallery/embellishments/colorbars_multiple.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
:gmt-docs:`cookbook/features.html#gmt-modern-mode-hierarchical-levels` for
details.
"""

# %%
import pygmt

fig = pygmt.Figure()
Expand Down
2 changes: 2 additions & 0 deletions examples/gallery/embellishments/inset.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
``position``, ``box``, ``offset``, and ``margin`` parameters are set. Plotting
methods called within the ``with`` statement are applied to the inset figure.
"""

# %%
import pygmt

fig = pygmt.Figure()
Expand Down
1 change: 1 addition & 0 deletions examples/gallery/embellishments/inset_rectangle_region.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
methods called within the ``with`` statement plot into the inset figure.
"""

# %%
import pygmt

# Set the region of the main figure
Expand Down
2 changes: 2 additions & 0 deletions examples/gallery/embellishments/legend.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
how to set up such a file, please see the GMT documentation at
https://docs.generic-mapping-tools.org/latest/legend.html#legend-codes.
"""

# %%
import pygmt

fig = pygmt.Figure()
Expand Down
1 change: 1 addition & 0 deletions examples/gallery/embellishments/logo.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
The :meth:`pygmt.Figure.logo` method allows to place the GMT logo on a map.
"""

# %%
import pygmt

fig = pygmt.Figure()
Expand Down
2 changes: 2 additions & 0 deletions examples/gallery/embellishments/solar.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
``"nautical"``, or ``"astronomical"`` (darkest).
Refer to https://en.wikipedia.org/wiki/Twilight for more information.
"""

# %%
import datetime

import pygmt
Expand Down
6 changes: 4 additions & 2 deletions examples/gallery/embellishments/timestamp.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
set to ``("-54p", "-54p")`` (x, y directions) and ``"BL"`` (bottom-left),
respectively.
"""
# sphinx_gallery_thumbnail_number = 2

# %%
import os

import pygmt
Expand All @@ -19,7 +19,7 @@
fig.timestamp()
fig.show()

###############################################################################
# %%
# Additionally, a custom label can be added via the ``label`` parameter. The
# font can be defined via the ``font`` parameter and the timestamp string
# format via ``timefmt``.
Expand All @@ -35,3 +35,5 @@
timefmt="%Y-%m-%dT%H:%M:%S%z",
)
fig.show()

# sphinx_gallery_thumbnail_number = 2
1 change: 1 addition & 0 deletions examples/gallery/histograms/blockm.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
inside each bin and how to report the number of points inside each bin.
"""

# %%
import pygmt

# Load sample data
Expand Down
1 change: 1 addition & 0 deletions examples/gallery/histograms/histogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
selected via the ``histtype`` parameter.
"""

# %%
import numpy as np
import pygmt

Expand Down
1 change: 1 addition & 0 deletions examples/gallery/histograms/rose.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
histograms.
"""

# %%
import pygmt

# Load sample compilation of fracture lengths and azimuth as
Expand Down
1 change: 1 addition & 0 deletions examples/gallery/histograms/scatter_and_histograms.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
:meth:`pygmt.Figure.shift_origin`.
"""

# %%
import numpy as np
import pygmt

Expand Down
2 changes: 1 addition & 1 deletion examples/gallery/images/contours.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
contours every 10 ``z`` values and annotations every 20 ``z`` values.
"""


# %%
import numpy as np
import pygmt

Expand Down
1 change: 1 addition & 0 deletions examples/gallery/images/cross_section.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
https://docs.gmt-china.org/latest/examples/ex026/
"""

# %%
import pygmt

# Define region of study area
Expand Down
1 change: 1 addition & 0 deletions examples/gallery/images/grdclip.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
value of -2000 m via the ``below`` parameter.
"""

# %%
import pygmt

fig = pygmt.Figure()
Expand Down
1 change: 1 addition & 0 deletions examples/gallery/images/grdgradient.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
direction and altitude.
"""

# %%
import pygmt

# Define region of interest around Yosemite valley
Expand Down
1 change: 1 addition & 0 deletions examples/gallery/images/grdgradient_shading.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
of each point.
"""

# %%
import pygmt

# Load the 3 arc-minutes global relief grid in the target area around Caucasus
Expand Down
1 change: 1 addition & 0 deletions examples/gallery/images/grdlandmask.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
the ``maskvalues`` parameter.
"""

# %%
import pygmt

fig = pygmt.Figure()
Expand Down
2 changes: 2 additions & 0 deletions examples/gallery/images/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
The ``position`` parameter allows us to set a reference point on the map for
the image.
"""

# %%
import os

import pygmt
Expand Down
6 changes: 4 additions & 2 deletions examples/gallery/images/rgb_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@
`OpenAerialMap <https://map.openaerialmap.org>`_ under a
`CC BY-NC 4.0 <https://creativecommons.org/licenses/by-nc/4.0/>`_ license.
"""

# %%
import pygmt
import rioxarray

###############################################################################
# %%
# Read 3-band data from GeoTIFF into an xarray.DataArray object:
with rioxarray.open_rasterio(
filename="https://oin-hotosm.s3.us-east-1.amazonaws.com/64d6a49a19cb3a000147a65b/0/64d6a49a19cb3a000147a65c.tif",
Expand All @@ -28,7 +30,7 @@
image = image.load() # Force loading the DataArray into memory
image

###############################################################################
# %%
# Plot the RGB imagery:
fig = pygmt.Figure()
with pygmt.config(FONT_TITLE="Times-Roman"): # Set title font to Times-Roman
Expand Down
1 change: 1 addition & 0 deletions examples/gallery/images/track_sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
argument needs to be passed to the ``outfile`` parameter.
"""

# %%
import pygmt

# Load sample grid and point datasets
Expand Down
2 changes: 1 addition & 1 deletion examples/gallery/lines/decorated_lines.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
:doc:`Line fronts example </gallery/lines/linefronts>`.
"""


# %%
import numpy as np
import pygmt

Expand Down
2 changes: 1 addition & 1 deletion examples/gallery/lines/envelope.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
case append ``"+d"`` or ``"+D"`` and for the latter case ``"+b"``.
"""


# %%
import pandas as pd
import pygmt

Expand Down
1 change: 1 addition & 0 deletions examples/gallery/lines/great_circles.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
``unit=True`` allows to set the unit for *p* to km.
"""

# %%
import pygmt

fig = pygmt.Figure()
Expand Down
1 change: 1 addition & 0 deletions examples/gallery/lines/line_custom_cpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

"""

# %%
import numpy as np
import pygmt

Expand Down
1 change: 1 addition & 0 deletions examples/gallery/lines/linefronts.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
:doc:`Line styles example </gallery/lines/linestyles>`.
"""

# %%
import numpy as np
import pygmt

Expand Down
1 change: 1 addition & 0 deletions examples/gallery/lines/linestyles.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

"""

# %%
import numpy as np
import pygmt

Expand Down
4 changes: 2 additions & 2 deletions examples/gallery/lines/quoted_lines.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
at https://docs.generic-mapping-tools.org/latest/plot.html#s.
"""

# %%
import numpy as np
import pygmt

Expand Down Expand Up @@ -71,8 +72,7 @@

fig.show()


###############################################################################
# %%
# For curved labels following the line, append ``"+v"`` to the argument passed
# to the ``style`` parameter.

Expand Down
1 change: 1 addition & 0 deletions examples/gallery/lines/roads.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
:meth:`pygmt.Figure.plot`, and style the geometry using the ``pen`` parameter.
"""

# %%
import geopandas as gpd
import pygmt

Expand Down
1 change: 1 addition & 0 deletions examples/gallery/lines/vector_heads_tails.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

"""

# %%
import pygmt

fig = pygmt.Figure()
Expand Down
2 changes: 2 additions & 0 deletions examples/gallery/lines/vector_styles.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
:doc:`Vector attributes example </gallery/lines/vector_heads_tails>`.

"""

# %%
import numpy as np
import pygmt

Expand Down
1 change: 1 addition & 0 deletions examples/gallery/lines/wiggle.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
parameters.
"""

# %%
import numpy as np
import pygmt

Expand Down
2 changes: 2 additions & 0 deletions examples/gallery/maps/borders.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
line color use ``borders="1/1p,black"``. You can draw multiple boundaries by
passing in a list to ``borders``.
"""

# %%
import pygmt

fig = pygmt.Figure()
Expand Down
10 changes: 5 additions & 5 deletions examples/gallery/maps/country_polygons.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
the individual names with commas.
"""

# sphinx_gallery_thumbnail_number = 1


# %%
import pygmt

fig = pygmt.Figure()
Expand Down Expand Up @@ -44,7 +42,7 @@

fig.show()

###############################################################################
# %%
# Entire continents can also be highlighted by adding ``"="`` in
# front of the continent code to differentiate it from a country code.

Expand Down Expand Up @@ -76,7 +74,7 @@

fig.show()

###############################################################################
# %%
# If available, states/territories of a country can be highlighted, too.

fig = pygmt.Figure()
Expand All @@ -97,3 +95,5 @@
)

fig.show()

# sphinx_gallery_thumbnail_number = 1
2 changes: 2 additions & 0 deletions examples/gallery/maps/land_and_water.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
names (like ``"skyblue"``), R/G/B levels (like ``"0/0/255"``), a hex value
(like ``"#333333"``), and a gray level (like ``"gray50"``).
"""

# %%
import pygmt

fig = pygmt.Figure()
Expand Down
Loading