按 Python 绘制数据集的地图图表
plot map chart of dataset by Python
我有一个 csv 文件,其中一列是位置。这些地点来自世界所有地区,但只有美国各州对我们很重要。数据集截图如下:
如何通过python绘制如下地图图表?
得到shape files for the US states and then you can plot a choropleth map with geopandas.
所以你想制作一个等值线图。我可以想到 Plotly 中的 Choropleth。 link 是 https://plotly.com/python/choropleth-maps/。如果您没有形状文件或 GeoJson,您可以使用 "Using Built-in Country and State Geometries" 部分中的代码,那么您将不需要形状文件或这些几何对象。还有,以后如果你想在Dash中做一些交互,你可以把这个图作为你在Dash中的一个图。
我有一个 csv 文件,其中一列是位置。这些地点来自世界所有地区,但只有美国各州对我们很重要。数据集截图如下:
如何通过python绘制如下地图图表?
得到shape files for the US states and then you can plot a choropleth map with geopandas.
所以你想制作一个等值线图。我可以想到 Plotly 中的 Choropleth。 link 是 https://plotly.com/python/choropleth-maps/。如果您没有形状文件或 GeoJson,您可以使用 "Using Built-in Country and State Geometries" 部分中的代码,那么您将不需要形状文件或这些几何对象。还有,以后如果你想在Dash中做一些交互,你可以把这个图作为你在Dash中的一个图。