title: Show Legend in Plotly Python
body: <p>I want to show the legend of the colors assigned to each marker. When I set <code>showlegend = True</code> it only shows one color, and that too with a wrong label. I added the output at the last from one of their examples.</p>
  
  <h1>Code</h1>
  
  <pre><code>    cities = [dict(
      type = 'scattergeo',
      locationmode = 'country names',
      lon = df['lng'].apply(lambda x: float(x)),
      lat = df['lat'].apply(lambda x: float(x)),
      text = df['name_of_city'],
      marker = dict(
          size = df['total_graduates'].apply(lambda x: float(x))/2000,
          color = df['effective_literacy_rate_total'],
          colorscale='Portland',
          line = dict(width=0.5, color='rgb(40,40,40)'),
          sizemode = 'area'
      )
  )]
  layout = dict(
          title = 'Top 500 Indian Cities by Population',
          showlegend = True,
          autosize=False,
          width=800,
          height=1000,
          geo = dict(
              resolution=100,
              scope='asia',
              lonaxis = dict( range= [ 65.0 ,100.0] ),
              lataxis = dict( range= [ 0.0,40.0 ] ),
              projection=dict( type = 'Mercator'),
              showland = True,
              landcolor = 'rgb(50,50,50)',
              subunitwidth=1,
              countrywidth=1,
              subunitcolor="rgb(255, 255, 255)",
              countrycolor="rgb(255, 255, 255)"
          ),
      )
  fig = dict( data=cities, layout=layout )
  iplot( fig, validate=False, filename='top-500-indian-cities' )
  </code></pre>
  
  <h1>Output</h1>
  
  <p><a href="https://i.stack.imgur.com/qEyq4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qEyq4.png" alt="enter image description here"></a></p>
  
  <h1>How do I show the colorscale legends like this one?</h1>
  
  <p><a href="https://i.stack.imgur.com/FJtX1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FJtX1.png" alt="enter image description here"></a></p>