python 导入离线地图_在python中离线绘制世界合唱团地图?

我试图重新创建plotlys示例页中给出的世界Choropleth地图:https://plot.ly/python/choropleth-maps/,目的是重用一些代码,但更改通知阴影和标签的列。在

但是,当我运行示例中给出的确切代码时,我收到以下错误。在plotly.exceptions.PlotlyError: Because you didn't supply a 'file_id' in the call, we're assuming you're trying to snag a figure from a url. You supplied the url, '', we expected it to start with 'https://plot.ly'.

Run help on this function for more information.

我不知道这个错误是从哪里来的,我的问题是如何调整代码,使其离线生成所述数字?其次,有没有一种简单的方法可以直接将图形保存到png中?抱歉,如果这是微不足道的,我是全新的包装。在

代码如下:import plotly.plotly as py

import pandas as pd

df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/2014_world_gdp_with_codes.csv')

data = [dict(

type='choropleth',

locations=df['CODE'],

z=df['

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值