最近给学员们免费新增空间数据可视化学习资源推荐~~内容时,发现了一个非常好用但非常小众的强悍空间可视化工具-「Antarctic-Plots」,今天这篇推文就简单介绍一下该工具。更多关于该工具的语法和案例,可以参与我们的课程哈,还有交流答疑群呢~~
Antarctic-Plots是一个专门用于绘制南极数据可视化自动化功能拓展Python库,目前还在开发过程中,但其现阶段已有的功能绘图结果都时非常惊艳的。
#构建虚拟环境
mamba create --name antarctic_plots --yes --force antarctic-plots
#激活环境
conda activate antarctic_plots
fig = maps.plot_grd(
ice_thickness,
fig_height=12, # set figure height
cmap="dense", # set the colormap
grd2cpt=True, #
coast=True, # plot grounding and coastlines
title="Amery Ice Shelf",
cbar_label="Ice thickness", # add label to colorbar
cbar_unit="m", # add units to y-axis of colorbar
inset=True, # add inset map showing location
inset_width=0.2,
scalebar=True, # add scalebar
scale_position="n.75/-.07",
gridlines=True, # add lat/lon gridlines
x_spacing=10, # longitude interval (degrees)
y_spacing=2, # latitude interval (degrees)
hist=True, # add a histogram to the colorbar
hist_bin_num=100, # 100 bins
)
# display the figure
fig.show()
A simple map
# define the region of interest
region = (150e3, 550e3, -1350e3, -1100e3)
# plot the imagery and some additonal map features
fig = maps.plot_grd(
imagery,
region=region,
image=True,
inset=True,
title="LIMA imagery",
gridlines=True,
x_spacing=10, # plot 10 degree longitude lines
y_spacing=2, # plot 2 degree latitude lines
)
fig.show()
Use with PyGMT
fig = maps.plot_3d(
grids=grids,
cmaps=["batlowW", "batlowW", "devon", "devon"],
exaggeration=[7, 20, 20, 20],
cbar_labels=["basement", "bed", "icebase", "surface"],
shp_mask=smooth_RIS,
region=region,
cbar_yshift=[2, 13, 13, 15.5],
zshifts=[-5, 4, 1.3, 0.5],
transparencies=[0, 0, 90, 80],
cpt_lims=[(-4e3, 0), (-1000, -200), (-600, 0), (0, 500)],
grd2cpt=False,
)
fig.show()
3D stack of grids
fig = maps.subplots(
grids,
plot_region,
margins="2c",
coast=True,
grd2cpt=True,
fig_title="Plotting multiple grids",
subplot_titles=[
"Ice thickness",
"GHF",
"Crustal thickness",
"Free-air gravity",
"Bouguer gravity",
"Basement elevation",
],
cmaps=[
"cool",
"solar",
"thermal",
"balance+h0",
"balance+h0",
"batlow",
],
cbar_labels=[
"BedMachine v1",
"Burton-Johnson et al. 2020",
"An et al. 2015",
"Forsberg et al. 2020",
"Forsberg et al. 2020",
"Tankersley et al. 2022",
],
cbar_units=["m", "mW/m@+2@", "m", "mGal", "mGal", "m"],
autolabel=True,
)
fig.show()
Organizing multiple subplots
更多关于该工具的用法和案例,感兴趣的同学可参考:Antarctic-Plots官网[1]
科研论文配图书籍学习圈子主要通过以下几个方面,给大家带来比纸质书籍更丰富的学习内容:
「PS」:我们直播教学内容为课堂式教学,原作者带着大家对书籍一章、一节、一页的进行教学。而且直播的视频都会通过剪辑后整理成课程,圈子中的同学可以免费、反复观看。当然,新增内容和定期答疑,直播也是如此。
[1]
Antarctic-Plots官网: https://antarctic-plots.readthedocs.io/en/latest/index.html。