Skip to content

Commit 61364c9

Browse files
authored
Plot only the magnetic anomaly for Osborne mine (#24)
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.
1 parent ab87a99 commit 61364c9

File tree

1 file changed

+25
-49
lines changed

1 file changed

+25
-49
lines changed

doc/gallery_src/osborne-magnetic.py

Lines changed: 25 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -36,56 +36,32 @@
3636
data
3737

3838
###############################################################################
39-
# Make two PyGMT maps with the data points colored by the total field magnetic
40-
# anomaly and also the observation height.
41-
42-
region = [
43-
data.longitude.min(),
44-
data.longitude.max(),
45-
data.latitude.min(),
46-
data.latitude.max(),
47-
]
48-
39+
# Make a PyGMT map with the data points colored by the total field magnetic
40+
# anomaly.
4941
fig = pygmt.Figure()
50-
with fig.subplot(
51-
nrows=1,
52-
ncols=2,
53-
figsize=("30c", "20c"),
54-
sharey="l", # shared y-axis on the left side
55-
frame="WSrt",
56-
):
57-
with fig.set_panel(0):
58-
fig.basemap(projection="M?", region=region, frame="af")
59-
scale = 1500
60-
pygmt.makecpt(cmap="polar+h", series=[-scale, scale], background=True)
61-
fig.plot(
62-
x=data.longitude,
63-
y=data.latitude,
64-
color=data.total_field_anomaly_nt,
65-
style="c0.075c",
66-
cmap=True,
67-
)
68-
fig.colorbar(
69-
frame='af+l"total field magnetic anomaly [nT]"',
70-
position="JBC+h+o0/1c+e",
71-
)
72-
with fig.set_panel(1):
73-
fig.basemap(projection="M?", region=region, frame="af")
74-
pygmt.makecpt(
75-
cmap="viridis",
76-
series=[data.height_orthometric_m.min(), data.height_orthometric_m.max()],
77-
)
78-
fig.plot(
79-
x=data.longitude,
80-
y=data.latitude,
81-
color=data.height_orthometric_m,
82-
style="c0.075c",
83-
cmap=True,
84-
)
85-
fig.colorbar(
86-
frame='af+l"observation height [m]"',
87-
position="JBC+h+o0/1c",
88-
)
42+
fig.basemap(
43+
projection="M15c",
44+
region=[
45+
data.longitude.min(),
46+
data.longitude.max(),
47+
data.latitude.min(),
48+
data.latitude.max(),
49+
],
50+
frame="af",
51+
)
52+
scale = 1500
53+
pygmt.makecpt(cmap="polar+h", series=[-scale, scale], background=True)
54+
fig.plot(
55+
x=data.longitude,
56+
y=data.latitude,
57+
color=data.total_field_anomaly_nt,
58+
style="c0.075c",
59+
cmap=True,
60+
)
61+
fig.colorbar(
62+
frame='af+l"total field magnetic anomaly [nT]"',
63+
position="JBC+h+o0/1c+e",
64+
)
8965
fig.show()
9066

9167
###############################################################################

0 commit comments

Comments
 (0)