我试图重新创建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['