Skip to content
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
5 changes: 4 additions & 1 deletion examples/gallery/lines/decorated_lines.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,16 @@
# %%
import numpy as np
import pygmt
from pygmt.params import Frame

# Generate a two-point line for plotting
x = np.array([1, 4])
y = np.array([24, 24])

fig = pygmt.Figure()
fig.basemap(region=[0, 10, 0, 24], projection="X15c", frame="+tDecorated Lines")
fig.basemap(
region=[0, 10, 0, 24], projection="X15c", frame=Frame(title="Decorated Lines")
)

# Plot different decorated lines
for decoline in [
Expand Down
5 changes: 4 additions & 1 deletion examples/gallery/lines/linefronts.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,16 @@
# %%
import numpy as np
import pygmt
from pygmt.params import Frame

# Generate a two-point line for plotting
x = np.array([1, 4])
y = np.array([20, 20])

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

# Plot the line using different front styles
for frontstyle in [
Expand Down
5 changes: 4 additions & 1 deletion examples/gallery/lines/linestyles.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,16 @@
# %%
import numpy as np
import pygmt
from pygmt.params import Frame

# Generate a two-point line for plotting
x = np.array([0, 7])
y = np.array([9, 9])

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

# Plot the line using the default line style
fig.plot(x=x, y=y)
Expand Down
5 changes: 4 additions & 1 deletion examples/gallery/lines/quoted_lines.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@
# %%
import numpy as np
import pygmt
from pygmt.params import Frame

# Generate a two-point line for plotting
x = np.array([1, 4])
y = np.array([20, 20])

fig = pygmt.Figure()
fig.basemap(region=[0, 10, 0, 20], projection="X15c/15c", frame="+tQuoted Lines")
fig.basemap(
region=[0, 10, 0, 20], projection="X15c/15c", frame=Frame(title="Quoted Lines")
)

# Plot different quoted lines
for quotedline in [
Expand Down
5 changes: 4 additions & 1 deletion examples/gallery/lines/vector_heads_tails.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,13 @@

# %%
import pygmt
from pygmt.params import Frame

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

x = 1
Expand Down
10 changes: 5 additions & 5 deletions examples/gallery/symbols/bars.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

# %%
import pygmt
from pygmt.params import Axis
from pygmt.params import Axis, Frame

fig = pygmt.Figure()

Expand All @@ -39,15 +39,15 @@
pen = "1.5p"
with fig.set_panel(panel=0):
fill = "skyblue"
fig.basemap(region=[0, 4, 0, 3], frame="+tvertical bars")
fig.basemap(region=[0, 4, 0, 3], frame=Frame(title="vertical bars"))
fig.plot(x=1, y=2, style="b0.5c", fill=fill, pen=pen)
fig.plot(x=2, y=2.5, style="b1c", fill=fill, pen=pen)
# +b1 means that the bar is starting from y=1 here
fig.plot(x=3, y=2.5, style="b0.75c+b1", fill=fill, pen=pen)

with fig.set_panel(panel=1):
fill = "tomato"
fig.basemap(region=[0, 4, 0, 3], frame="+thorizontal bars")
fig.basemap(region=[0, 4, 0, 3], frame=Frame(title="horizontal bars"))
fig.plot(x=1.5, y=0.5, style="B0.75c", fill=fill, pen=pen)
fig.plot(x=3, y=1.5, style="B1c", fill=fill, pen=pen)
# +b2 means that the bar is starting from x=2 here
Expand All @@ -63,11 +63,11 @@
}

with fig.set_panel(panel=2):
fig.basemap(region=[0, 4, 0, 3], frame="+tstacked bars")
fig.basemap(region=[0, 4, 0, 3], frame=Frame(title="stacked bars"))
fig.plot(data=data, style="B0.75c+i4", cmap=True, pen=pen)

with fig.set_panel(panel=3):
fig.basemap(region=[0, 4, 0, 3], frame="+tsplit bars")
fig.basemap(region=[0, 4, 0, 3], frame=Frame(title="split bars"))
fig.plot(data=data, style="B1c+v4+s", cmap=True, pen=pen)

fig.show()
4 changes: 2 additions & 2 deletions pygmt/tests/test_subplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ def test_subplot_basic_frame():

with fig.subplot(nrows=1, ncols=2, figsize=("6c", "3c"), frame=Frame(axes="WSne")):
with fig.set_panel(panel="0,0"):
fig.basemap(region=[0, 3, 0, 3], frame="+tplot0")
fig.basemap(region=[0, 3, 0, 3], frame=Frame(title="plot0"))
with fig.set_panel(panel=[0, 1]):
fig.basemap(region=[0, 3, 0, 3], frame="+tplot1")
fig.basemap(region=[0, 3, 0, 3], frame=Frame(title="plot1"))
return fig


Expand Down
Loading