title: Plotly world Choropleth Map offline in python?
body: <p>I'm trying to recreate the world Choropleth map given in plotlys example page here:  <a href="https://plot.ly/python/choropleth-maps/" rel="nofollow noreferrer">https://plot.ly/python/choropleth-maps/</a> with the intention of reusing some of the code, but changing the column which informs the shadings and the labelling. </p>
  
  <p>However when I run the exact code given in the example I receive the following error. </p>
  
  <blockquote>
    <p>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 '<a href="https://plot.ly" rel="nofollow noreferrer">https://plot.ly</a>'.
    Run help on this function for more information.</p>
  </blockquote>
  
  <p>I have no idea where this error arises from and my question really is how do I adapt the code so that it produces the said figure offline? Secondly is there a simple method for saving the figure directly to a png? Apologies if this is trivial I'm completely new to the package.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>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['GDP (BILLIONS)'],
      text=df['COUNTRY'],
      colorscale=[[0, "rgb(5, 10, 172)"], [0.35, "rgb(40, 60, 190)"], [0.5, "rgb(70, 100, 245)"],\
                  [0.6, "rgb(90, 120, 245)"], [0.7, "rgb(106, 137, 247)"], [1, "rgb(220, 220, 220)"]],
      autocolorscale=False,
      reversescale=True,
      marker=dict(
          line=dict(
              color='rgb(180,180,180)',
              width=0.5
          )),
      colorbar=dict(
          autotick=False,
          tickprefix='$',
          title='GDP&lt;br&gt;Billions US$'),
  )]
  
  layout = dict(
      title='2014 Global GDP&lt;br&gt;Source:\
              &lt;a href="https://www.cia.gov/library/publications/the-world-factbook/fields/2195.html"&gt;\
              CIA World Factbook&lt;/a&gt;',
      geo=dict(
          showframe=False,
          showcoastlines=False,
          projection=dict(
              type='Mercator'
          )
      )
  )
  
  fig = dict(data=data, layout=layout)
  py.iplot(fig,validate=False, filename='d3-world-map')
  </code></pre>