我試圖從一個具有以下結構的geojson中進行繪圖:
import geopandas as gpd
states = gpd.read_file('diamante.geojson' )
display(states.head())
這是通過使用mygeoconverter從.shp、shx、prj等轉換得到的。鏈接列是我的參考,以便以后與另一個帶有適當標簽的資料框架合并。形狀資訊似乎很好,因為我從geopandas得到了一個基本的圖。
states.plot(aspect=1)
我不知道為什么我需要 aspect=1 這個引數才能作業。當我試圖用plotly來繪制我的地圖時,我得到了以下結果:
import pyproj
#states.to_crs(yproj.CRS.from_epsg(4326), inplace=True)
fig = px.choropleth(state, geojson=states['geometry'], locations=states.index, color=states.varon)
fig.show()
這行注釋是根據另一個帖子試圖解決這個問題,但似乎并沒有什么效果。我是繪圖的新手,所以我不知道該找什么。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/312374.html
標籤:
上一篇:從串列中提取
下一篇:如何從Counter庫中繪圖?



