Skip to content

Commit

Permalink
Plot only the magnetic anomaly for Osborne mine (#24)
Browse files Browse the repository at this point in the history
Adding a plot of the flight height takes double the time and doesn't
include any more useful information. Plot only the anomaly data instead.
Also avoids the PyGMT subplot code that can be a bit confusing.
  • Loading branch information
leouieda authored Feb 21, 2022
1 parent ab87a99 commit 61364c9
Showing 1 changed file with 25 additions and 49 deletions.
74 changes: 25 additions & 49 deletions doc/gallery_src/osborne-magnetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,56 +36,32 @@
data

###############################################################################
# Make two PyGMT maps with the data points colored by the total field magnetic
# anomaly and also the observation height.

region = [
data.longitude.min(),
data.longitude.max(),
data.latitude.min(),
data.latitude.max(),
]

# Make a PyGMT map with the data points colored by the total field magnetic
# anomaly.
fig = pygmt.Figure()
with fig.subplot(
nrows=1,
ncols=2,
figsize=("30c", "20c"),
sharey="l", # shared y-axis on the left side
frame="WSrt",
):
with fig.set_panel(0):
fig.basemap(projection="M?", region=region, frame="af")
scale = 1500
pygmt.makecpt(cmap="polar+h", series=[-scale, scale], background=True)
fig.plot(
x=data.longitude,
y=data.latitude,
color=data.total_field_anomaly_nt,
style="c0.075c",
cmap=True,
)
fig.colorbar(
frame='af+l"total field magnetic anomaly [nT]"',
position="JBC+h+o0/1c+e",
)
with fig.set_panel(1):
fig.basemap(projection="M?", region=region, frame="af")
pygmt.makecpt(
cmap="viridis",
series=[data.height_orthometric_m.min(), data.height_orthometric_m.max()],
)
fig.plot(
x=data.longitude,
y=data.latitude,
color=data.height_orthometric_m,
style="c0.075c",
cmap=True,
)
fig.colorbar(
frame='af+l"observation height [m]"',
position="JBC+h+o0/1c",
)
fig.basemap(
projection="M15c",
region=[
data.longitude.min(),
data.longitude.max(),
data.latitude.min(),
data.latitude.max(),
],
frame="af",
)
scale = 1500
pygmt.makecpt(cmap="polar+h", series=[-scale, scale], background=True)
fig.plot(
x=data.longitude,
y=data.latitude,
color=data.total_field_anomaly_nt,
style="c0.075c",
cmap=True,
)
fig.colorbar(
frame='af+l"total field magnetic anomaly [nT]"',
position="JBC+h+o0/1c+e",
)
fig.show()

###############################################################################
Expand Down

0 comments on commit 61364c9

Please sign in to comment.