Use with PyGMT#
Here we demonstrate how to use the figure output from PolarToolkit with normal PyGMT commands. PyGMT offers much more flexibility than PolarToolkit, so if you want to change lots of details of a figure, we recommend using this approach.
[1]:
import polartoolkit as ptk
Fetch the Bedmap2 surface topography.
[2]:
surface = ptk.fetch.bedmap2(layer="surface")
[3]:
# define the region of interest
region = (150e3, 550e3, -1350e3, -1100e3)
# plot the imagery and some additional map features
fig = ptk.basemap(
imagery_basemap=True, # GMT automatically recognizes that this is imagery and sets colorscale
region=region,
inset=True,
title="LIMA imagery",
gridlines=True,
x_spacing=5, # plot 10 degree longitude lines
y_spacing=1, # plot 2 degree latitude lines
hemisphere="south",
)
fig.show(dpi=200)
Use additional PyGMT plotting methods on the figure
[4]:
# add surface elevation contours
fig.grdcontour(grid=surface, levels=500, pen="thick,red")
# add a point and label
fig.plot(x=285000, y=-1130000, style="a0.5c", pen="1p,black", fill="darkorange")
fig.text(x=285000, y=-1130000, text="Discovery Deep", offset="0c/.5c")
# show the figure
fig.show(dpi=200)
[ ]: