Skip to content

Commit f2fb71f

Browse files
Consistent usage of whitespaces across gallery and tutorial examples (#2018)
1 parent 4902687 commit f2fb71f

File tree

14 files changed

+23
-35
lines changed

14 files changed

+23
-35
lines changed

examples/gallery/3d_plots/scatter3d.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@
7979
region=region,
8080
# Set frame parameters
8181
frame=[
82-
'WsNeZ3+t"Iris flower data set"', # z axis label positioned on 3rd corner, add title
83-
'xafg+l"Petal Width (cm)"',
84-
'yafg+l"Sepal Length (cm)"',
85-
'zafg+l"Petal Length (cm)"',
82+
"WsNeZ3+tIris flower data set", # z axis label positioned on 3rd corner, add title
83+
"xafg+lPetal Width (cm)",
84+
"yafg+lSepal Length (cm)",
85+
"zafg+lPetal Length (cm)",
8686
],
8787
# Set perspective to azimuth NorthWest (315°), at elevation 25°
8888
perspective=[315, 25],

examples/gallery/embellishments/colorbar.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import pygmt
2525

2626
fig = pygmt.Figure()
27-
fig.basemap(region=[0, 3, 6, 9], projection="x3c", frame=["af", 'WSne+t"Colorbars"'])
27+
fig.basemap(region=[0, 3, 6, 9], projection="x3c", frame=["af", "WSne+tColorbars"])
2828

2929
## Create a colorbar designed for seismic tomography - roma
3030
# Colorbar is placed at bottom center (BC) by default if no position is given

examples/gallery/histograms/blockm.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
fig.grdimage(
3131
grid=grd,
3232
region=region,
33-
frame=["af", '+t"Mean earthquake depth inside each block"'],
33+
frame=["af", "+tMean earthquake depth inside each block"],
3434
cmap="batlow",
3535
)
3636
# plot slightly transparent landmasses on top
@@ -51,7 +51,7 @@
5151
fig.grdimage(
5252
grid=grd,
5353
region=region,
54-
frame=["af", '+t"Number of points inside each block"'],
54+
frame=["af", "+tNumber of points inside each block"],
5555
cmap="batlow",
5656
)
5757
fig.coast(land="darkgray", transparency=40)

examples/gallery/histograms/histogram.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
data=data,
2424
# define the frame, add title and set background color to
2525
# lightgray, add annotations for x and y axis
26-
frame=['WSne+t"Histogram"+glightgray', 'x+l"Elevation (m)"', 'y+l"Counts"'],
26+
frame=["WSne+tHistogram+glightgray", "x+lElevation (m)", "y+lCounts"],
2727
# generate evenly spaced bins by increments of 5
2828
series=5,
2929
# use red3 as color fill for the bars

examples/gallery/images/grdclip.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
grid = pygmt.datasets.load_earth_relief(resolution="03m", region=region)
1919

2020
# Plot original grid
21-
fig.basemap(region=region, projection="M12c", frame=["f", '+t"original grid"'])
21+
fig.basemap(region=region, projection="M12c", frame=["f", "+toriginal grid"])
2222
fig.grdimage(grid=grid, cmap="oleron")
2323

2424
# Shift plot origin of the second map by "width of the first map + 0.5 cm"
@@ -29,7 +29,7 @@
2929
grid = pygmt.grdclip(grid, below=[0, -2000])
3030

3131
# Plot clipped grid
32-
fig.basemap(region=region, projection="M12c", frame=["f", '+t"clipped grid"'])
32+
fig.basemap(region=region, projection="M12c", frame=["f", "+tclipped grid"])
3333
fig.grdimage(grid=grid)
3434
fig.colorbar(frame=["x+lElevation", "y+lm"], position="JMR+o0.5c/0c+w8c")
3535

examples/gallery/images/grdgradient.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
fig.grdimage(
3333
grid=grid,
3434
projection="M12c",
35-
frame=['WSrt+t"Original Data Elevation Model"', "xa0.1", "ya0.1"],
35+
frame=["WSrt+tOriginal Data Elevation Model", "xa0.1", "ya0.1"],
3636
cmap=True,
3737
)
3838

@@ -47,7 +47,7 @@
4747
fig.grdimage(
4848
grid=dgrid,
4949
projection="M12c",
50-
frame=['lSEt+t"Hillshade Map"', "xa0.1", "ya0.1"],
50+
frame=["lSEt+tHillshade Map", "xa0.1", "ya0.1"],
5151
cmap=True,
5252
)
5353

examples/gallery/lines/linefronts.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
y = np.array([20, 20])
3838

3939
fig = pygmt.Figure()
40-
fig.basemap(region=[0, 10, 0, 20], projection="X15c/15c", frame='+t"Line Fronts"')
40+
fig.basemap(region=[0, 10, 0, 20], projection="X15c/15c", frame="+tLine Fronts")
4141

4242
# Plot the line using different front styles
4343
for frontstyle in [

examples/gallery/lines/linestyles.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
y = np.array([9, 9])
2626

2727
fig = pygmt.Figure()
28-
fig.basemap(region=[0, 10, 0, 10], projection="X15c/8c", frame='+t"Line Styles"')
28+
fig.basemap(region=[0, 10, 0, 10], projection="X15c/8c", frame="+tLine Styles")
2929

3030
# Plot the line using the default line style
3131
fig.plot(x=x, y=y)

examples/gallery/lines/roads.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
region = [-158.3, -157.6, 21.2, 21.75] # xmin, xmax, ymin, ymax
2929

3030
title = r"Main roads of O\047ahu (Hawai\047i)" # \047 is octal code for '
31-
fig.basemap(region=region, projection="M12c", frame=["af", f'WSne+t"{title}"'])
31+
fig.basemap(region=region, projection="M12c", frame=["af", f"WSne+t{title}"])
3232
fig.coast(land="gray", water="dodgerblue4", shorelines="1p,black")
3333

3434
# Plot the individual road types with different pen settings and assign labels

examples/gallery/lines/vector_heads_tails.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
fig = pygmt.Figure()
3737
fig.basemap(
38-
region=[0, 10, 0, 15], projection="X15c/10c", frame='+t"Vector heads and tails"'
38+
region=[0, 10, 0, 15], projection="X15c/10c", frame="+tVector heads and tails"
3939
)
4040

4141
x = 1

examples/gallery/symbols/points_categorical.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@
4848
region=region,
4949
projection="X10c/10c",
5050
frame=[
51-
'xafg+l"Bill length (mm)"',
52-
'yafg+l"Bill depth (mm)"',
53-
'WSen+t"Penguin size at Palmer Station"',
51+
"xafg+lBill length (mm)",
52+
"yafg+lBill depth (mm)",
53+
"WSen+tPenguin size at Palmer Station",
5454
],
5555
)
5656

examples/gallery/symbols/points_transparency.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
fig = pygmt.Figure()
1919
fig.basemap(
2020
region=[-5, 105, 0, 2],
21-
frame=['xaf+l"Transparency level"+u%', "WSrt"],
21+
frame=["xaf+lTransparency level+u%", "WSrt"],
2222
projection="X15c/6c",
2323
)
2424
fig.plot(x=x, y=y, style="c0.6c", color="blue", pen="1p,red", transparency=transparency)

examples/tutorials/basics/frames.py

+2-14
Original file line numberDiff line numberDiff line change
@@ -58,21 +58,9 @@
5858
# ``frame`` can be done by using a list, as show in the example below.
5959

6060
fig = pygmt.Figure()
61-
# region="IS" specifies Iceland using the ISO country code
62-
fig.coast(shorelines="1/0.5p", region="IS", projection="M25c")
63-
fig.basemap(frame=["a", "+tIceland"])
64-
fig.show()
65-
66-
###############################################################################
67-
# To use a title with multiple words, the title must be placed inside another
68-
# set of quotation marks. To prevent the quotation marks from appearing in the
69-
# figure title, the ``frame`` parameter can be passed in single quotation marks
70-
# and the title can be passed in double quotation marks.
71-
72-
fig = pygmt.Figure()
73-
# region="TT" specifies Trinidad and Tobago
61+
# region="TT" specifies Trinidad and Tobago using the ISO country code
7462
fig.coast(shorelines="1/0.5p", region="TT", projection="M25c")
75-
fig.basemap(frame=["a", '+t"Trinidad and Tobago"'])
63+
fig.basemap(frame=["a", "+tTrinidad and Tobago"])
7664
fig.show()
7765

7866
###############################################################################

examples/tutorials/basics/plot.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,5 +91,5 @@
9191
style="cc",
9292
pen="black",
9393
)
94-
fig.colorbar(frame='af+l"Depth (km)"')
94+
fig.colorbar(frame="af+lDepth (km)")
9595
fig.show()

0 commit comments

Comments
 (0)