绘制地图投影类型

Plotly map projection types

正在尝试查找 plotly 中可用的不同类型项目的列表

来自不同样本的投影类型:

projection = list(type = "equirectangular")
projection = list(type = 'azimuthal equal area'),
projection = dict(type = 'Mercator')

任何在线文档都会有所帮助

这是一个包含所有支持的投影的下拉列表:

https://plot.ly/python/dropdowns/

以下是更全面的世界预测列表:

  1. 等距柱状
  2. 墨卡托
  3. 正交
  4. 自然大地
  5. Kavrayskiy7
  6. 米勒
  7. 罗宾逊
  8. 埃克特4
  9. 方位等面积
  10. 方位等距
  11. 圆锥等面积
  12. 圆锥共形
  13. 等距圆锥曲线
  14. 日式
  15. 立体
  16. 摩尔维德
  17. 锤子
  18. 横向墨卡托

此 github 显示不同的投影: http://etpinard.github.io/plotly-dashboards/map-projections/

list of map projections(带图片)在维基百科上可用。

已接受的答案不再列出预测。我可以在 plotly.py source code. But I think that plotly.js really uses D3.js projections.

中找到可用的投影

他们在这里:

  • 等距柱状
  • 墨卡托
  • 正字法
  • 自然大地
  • kavrayskiy7
  • 米勒'
  • 罗宾逊'
  • eckert4'
  • 方位角等面积
  • 方位等距
  • 圆锥等面积
  • 圆锥共形
  • 圆锥等距
  • gnomonic
  • 立体
  • 摩尔维德
  • 锤子
  • 横向墨卡托
  • 阿尔伯斯美国

2021年答案:

此代码将向您显示所有可能的投影(transverse mercator 除外,它不适用于此示例数据,但当我使用不同的数据进行测试时它有效)。

地图图表将保存到 ./projections/ 文件夹。

投影列表来源:https://plotly.com/python/map-configuration/#map-projections

import plotly.express as px
from pathlib import Path

df = px.data.election()
geojson = px.data.election_geojson()

fig = px.choropleth(df, geojson=geojson, color="Bergeron",
                    locations="district", featureidkey="properties.district")

fig.update_layout(margin={"r":10,"t":50,"l":10,"b":10})
fig.update_geos(fitbounds='locations', resolution=50,scope='north america')


projections = ['equirectangular', 'mercator', 'orthographic', 'natural earth',
 'kavrayskiy7', 'miller', 'robinson', 'eckert4', 'azimuthal equal area', 
 'azimuthal equidistant', 'conic equal area', 'conic conformal',
 'conic equidistant', 'gnomonic', 'stereographic', 'mollweide', 'hammer',
 'transverse mercator', 'albers usa', 'winkel tripel', 'aitoff', 'sinusoidal']


Path('./projections/').mkdir(parents=True, exist_ok=True)

for p in projections:
    fig.update_geos(projection_type=p)
    fig.update_layout(title=p)
    path=f'./projections/{p}.png'
    fig.write_image(file=path,width=960,height=540,scale=2)