Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coding report@20231103 --> Add spatial visualization notebook. Still exist bugs when visualizing the spatial frequency of different samples. #4

Open
KeranLi opened this issue Nov 3, 2023 · 0 comments
Assignees

Comments

@KeranLi
Copy link
Owner

KeranLi commented Nov 3, 2023

Image

counts = df.groupby(['Latitud', 'Logitud'])['Latitud'].count()

counts = counts.reset_index(name='counts')

data = df.merge(counts, on=['Latitud', 'Logitud'])

# 载入地形数据
grid = pygmt.datasets.load_earth_relief(resolution='01m', region=[70, 140, 0, 55])

# 创建图形
fig = pygmt.Figure()

# 绘制地形图  
fig.grdimage(grid=grid, projection='M15c', frame='a', cmap='geo')

# 在地图上绘制点 
fig.plot(x=data['Logitud'], y=data['Latitud'], c=data['counts'], cmap='hot', style='c0.5c')

# 添加颜色条标注  
fig.colorbar(frame=["a2000", "x+lElevation", "y+lm"])

fig.colorbar(frame='af+lFrequency')

# 显示结果
fig.show()

Canceled future for execute_request message before replies were done
在当前单元格或上一个单元格中执行代码时 Kernel 崩溃。请查看单元格中的代码,以确定故障的可能原因。有关详细信息,请单击 此处。有关更多详细信息,请查看 Jupyter log。

@KeranLi KeranLi self-assigned this Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant