diff --git a/examples/gallery/lines/decorated_lines.py b/examples/gallery/lines/decorated_lines.py index 3a033e885c9..1a8cecffa8e 100644 --- a/examples/gallery/lines/decorated_lines.py +++ b/examples/gallery/lines/decorated_lines.py @@ -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 [ diff --git a/examples/gallery/lines/linefronts.py b/examples/gallery/lines/linefronts.py index 8c85c9f09a0..67f6b492eac 100644 --- a/examples/gallery/lines/linefronts.py +++ b/examples/gallery/lines/linefronts.py @@ -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 [ diff --git a/examples/gallery/lines/linestyles.py b/examples/gallery/lines/linestyles.py index 9bfa664ff11..70571a4ec10 100644 --- a/examples/gallery/lines/linestyles.py +++ b/examples/gallery/lines/linestyles.py @@ -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) diff --git a/examples/gallery/lines/quoted_lines.py b/examples/gallery/lines/quoted_lines.py index 2b112912522..b04bc1c2e0b 100644 --- a/examples/gallery/lines/quoted_lines.py +++ b/examples/gallery/lines/quoted_lines.py @@ -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 [ diff --git a/examples/gallery/lines/vector_heads_tails.py b/examples/gallery/lines/vector_heads_tails.py index aa10492de76..a25fef7284e 100644 --- a/examples/gallery/lines/vector_heads_tails.py +++ b/examples/gallery/lines/vector_heads_tails.py @@ -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 diff --git a/examples/gallery/symbols/bars.py b/examples/gallery/symbols/bars.py index 1dcb8f4650f..551f2caba3e 100644 --- a/examples/gallery/symbols/bars.py +++ b/examples/gallery/symbols/bars.py @@ -21,7 +21,7 @@ # %% import pygmt -from pygmt.params import Axis +from pygmt.params import Axis, Frame fig = pygmt.Figure() @@ -39,7 +39,7 @@ 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 @@ -47,7 +47,7 @@ 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 @@ -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() diff --git a/pygmt/tests/test_subplot.py b/pygmt/tests/test_subplot.py index 51322f1b358..7de967f85c0 100644 --- a/pygmt/tests/test_subplot.py +++ b/pygmt/tests/test_subplot.py @@ -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