Skip to content

Commit 6c61a0c

Browse files
committed
Merge branch 'fix-fig-region' of github.com:Chuan1937/pygmt into fix-fig-region
2 parents bf05ab0 + 97794f9 commit 6c61a0c

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

examples/tutorials/basics/plot.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import io
1414

1515
import pygmt
16-
from pygmt.params import Position
16+
from pygmt.params import Box, Position
1717

1818
# %%
1919
# For example, let's load the sample dataset of tsunami generating earthquakes
@@ -72,7 +72,12 @@
7272
legend = io.StringIO(
7373
"\n".join(f"S 0.4 c {0.02 * 2**m:.2f} - 1p 1 Mw {m}" for m in [3, 4, 5])
7474
)
75-
fig.legend(spec=legend, position=Position("BR", offset=0.2), line_spacing=2.0, box=True)
75+
fig.legend(
76+
spec=legend,
77+
position=Position("BR", offset=0.2),
78+
line_spacing=2,
79+
box=Box(fill="white", pen="black"),
80+
)
7681
fig.show()
7782

7883
# %%
@@ -104,7 +109,12 @@
104109
pen="black",
105110
)
106111
fig.colorbar(frame="xaf+lDepth (km)")
107-
fig.legend(spec=legend, position=Position("BR", offset=0.2), line_spacing=2.0, box=True)
112+
fig.legend(
113+
spec=legend,
114+
position=Position("BR", offset=0.2),
115+
line_spacing=2,
116+
box=Box(fill="white", pen="black"),
117+
)
108118
fig.show()
109119

110120
# sphinx_gallery_thumbnail_number = 3

0 commit comments

Comments
 (0)