Skip to content

Consistent usage of whitespaces across gallery and tutorial examples #2018

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Jul 25, 2022
Merged
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
8 changes: 4 additions & 4 deletions examples/gallery/3d_plots/scatter3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@
region=region,
# Set frame parameters
frame=[
'WsNeZ3+t"Iris flower data set"', # z axis label positioned on 3rd corner, add title
'xafg+l"Petal Width (cm)"',
'yafg+l"Sepal Length (cm)"',
'zafg+l"Petal Length (cm)"',
"WsNeZ3+tIris flower data set", # z axis label positioned on 3rd corner, add title
"xafg+lPetal Width (cm)",
"yafg+lSepal Length (cm)",
"zafg+lPetal Length (cm)",
],
# Set perspective to azimuth NorthWest (315°), at elevation 25°
perspective=[315, 25],
Expand Down
2 changes: 1 addition & 1 deletion examples/gallery/embellishments/colorbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import pygmt

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

## Create a colorbar designed for seismic tomography - roma
# Colorbar is placed at bottom center (BC) by default if no position is given
Expand Down
4 changes: 2 additions & 2 deletions examples/gallery/histograms/blockm.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
fig.grdimage(
grid=grd,
region=region,
frame=["af", '+t"Mean earthquake depth inside each block"'],
frame=["af", "+tMean earthquake depth inside each block"],
cmap="batlow",
)
# plot slightly transparent landmasses on top
Expand All @@ -51,7 +51,7 @@
fig.grdimage(
grid=grd,
region=region,
frame=["af", '+t"Number of points inside each block"'],
frame=["af", "+tNumber of points inside each block"],
cmap="batlow",
)
fig.coast(land="darkgray", transparency=40)
Expand Down
2 changes: 1 addition & 1 deletion examples/gallery/histograms/histogram.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
data=data,
# define the frame, add title and set background color to
# lightgray, add annotations for x and y axis
frame=['WSne+t"Histogram"+glightgray', 'x+l"Elevation (m)"', 'y+l"Counts"'],
frame=["WSne+tHistogram+glightgray", "x+lElevation (m)", "y+lCounts"],
# generate evenly spaced bins by increments of 5
series=5,
# use red3 as color fill for the bars
Expand Down
4 changes: 2 additions & 2 deletions examples/gallery/images/grdclip.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
grid = pygmt.datasets.load_earth_relief(resolution="03m", region=region)

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

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

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

Expand Down
4 changes: 2 additions & 2 deletions examples/gallery/images/grdgradient.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
fig.grdimage(
grid=grid,
projection="M12c",
frame=['WSrt+t"Original Data Elevation Model"', "xa0.1", "ya0.1"],
frame=["WSrt+tOriginal Data Elevation Model", "xa0.1", "ya0.1"],
cmap=True,
)

Expand All @@ -47,7 +47,7 @@
fig.grdimage(
grid=dgrid,
projection="M12c",
frame=['lSEt+t"Hillshade Map"', "xa0.1", "ya0.1"],
frame=["lSEt+tHillshade Map", "xa0.1", "ya0.1"],
cmap=True,
)

Expand Down
2 changes: 1 addition & 1 deletion examples/gallery/lines/linefronts.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
y = np.array([20, 20])

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

# Plot the line using different front styles
for frontstyle in [
Expand Down
2 changes: 1 addition & 1 deletion examples/gallery/lines/linestyles.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
y = np.array([9, 9])

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

# Plot the line using the default line style
fig.plot(x=x, y=y)
Expand Down
2 changes: 1 addition & 1 deletion examples/gallery/lines/roads.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
region = [-158.3, -157.6, 21.2, 21.75] # xmin, xmax, ymin, ymax

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

# Plot the individual road types with different pen settings and assign labels
Expand Down
2 changes: 1 addition & 1 deletion examples/gallery/lines/vector_heads_tails.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

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

x = 1
Expand Down
6 changes: 3 additions & 3 deletions examples/gallery/symbols/points_categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
region=region,
projection="X10c/10c",
frame=[
'xafg+l"Bill length (mm)"',
'yafg+l"Bill depth (mm)"',
'WSen+t"Penguin size at Palmer Station"',
"xafg+lBill length (mm)",
"yafg+lBill depth (mm)",
"WSen+tPenguin size at Palmer Station",
],
)

Expand Down
2 changes: 1 addition & 1 deletion examples/gallery/symbols/points_transparency.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
fig = pygmt.Figure()
fig.basemap(
region=[-5, 105, 0, 2],
frame=['xaf+l"Transparency level"+u%', "WSrt"],
frame=["xaf+lTransparency level+u%", "WSrt"],
projection="X15c/6c",
)
fig.plot(x=x, y=y, style="c0.6c", color="blue", pen="1p,red", transparency=transparency)
Expand Down
16 changes: 2 additions & 14 deletions examples/tutorials/basics/frames.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,9 @@
# ``frame`` can be done by using a list, as show in the example below.

fig = pygmt.Figure()
# region="IS" specifies Iceland using the ISO country code
fig.coast(shorelines="1/0.5p", region="IS", projection="M25c")
fig.basemap(frame=["a", "+tIceland"])
fig.show()

###############################################################################
# To use a title with multiple words, the title must be placed inside another
# set of quotation marks. To prevent the quotation marks from appearing in the
# figure title, the ``frame`` parameter can be passed in single quotation marks
# and the title can be passed in double quotation marks.

fig = pygmt.Figure()
# region="TT" specifies Trinidad and Tobago
# region="TT" specifies Trinidad and Tobago using the ISO country code
fig.coast(shorelines="1/0.5p", region="TT", projection="M25c")
fig.basemap(frame=["a", '+t"Trinidad and Tobago"'])
fig.basemap(frame=["a", "+tTrinidad and Tobago"])
fig.show()

###############################################################################
Expand Down
2 changes: 1 addition & 1 deletion examples/tutorials/basics/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,5 @@
style="cc",
pen="black",
)
fig.colorbar(frame='af+l"Depth (km)"')
fig.colorbar(frame="af+lDepth (km)")
fig.show()