diff --git a/examples/tutorials/basics/plot.py b/examples/tutorials/basics/plot.py index 27070e6137d..e402376eb71 100644 --- a/examples/tutorials/basics/plot.py +++ b/examples/tutorials/basics/plot.py @@ -13,7 +13,7 @@ import io import pygmt -from pygmt.params import Position +from pygmt.params import Box, Position # %% # For example, let's load the sample dataset of tsunami generating earthquakes @@ -72,7 +72,12 @@ legend = io.StringIO( "\n".join(f"S 0.4 c {0.02 * 2**m:.2f} - 1p 1 Mw {m}" for m in [3, 4, 5]) ) -fig.legend(spec=legend, position=Position("BR", offset=0.2), line_spacing=2.0, box=True) +fig.legend( + spec=legend, + position=Position("BR", offset=0.2), + line_spacing=2, + box=Box(fill="white", pen="black"), +) fig.show() # %% @@ -104,7 +109,12 @@ pen="black", ) fig.colorbar(frame="xaf+lDepth (km)") -fig.legend(spec=legend, position=Position("BR", offset=0.2), line_spacing=2.0, box=True) +fig.legend( + spec=legend, + position=Position("BR", offset=0.2), + line_spacing=2, + box=Box(fill="white", pen="black"), +) fig.show() # sphinx_gallery_thumbnail_number = 3