|
36 | 36 | data |
37 | 37 |
|
38 | 38 | ############################################################################### |
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. |
49 | 41 | 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 | +) |
89 | 65 | fig.show() |
90 | 66 |
|
91 | 67 | ############################################################################### |
|
0 commit comments