title: Plotly: Write numbers on Choropleth of the US
body: <p>For a math assignment I'm working on the distribution of the Electoral College of the US and on the distribution of the electors. I solve a LP to redefine this distribution according to nowadays population in each state.</p>
  <p>Now I want to plot my results on a map of the US. I used Plotly to do that. Here is my code :</p>
  <pre><code>import plotly.graph_objects as go
  
  locations = [&quot;AL&quot;, &quot;AK&quot;, &quot;AZ&quot;, &quot;AR&quot;, &quot;CA&quot;, &quot;CO&quot;, &quot;CT&quot;, &quot;DE&quot;, &quot;DC&quot;, &quot;FL&quot;, &quot;GA&quot;, &quot;HI&quot;, &quot;ID&quot;, &quot;IL&quot;, &quot;IN&quot;, &quot;IA&quot;, &quot;KS&quot;, &quot;KY&quot;,
               &quot;LA&quot;, &quot;ME&quot;, &quot;MD&quot;, &quot;MA&quot;, &quot;MI&quot;, &quot;MN&quot;, &quot;MS&quot;, &quot;MO&quot;, &quot;MT&quot;, &quot;NE&quot;, &quot;NV&quot;, &quot;NH&quot;, &quot;NJ&quot;, &quot;NM&quot;, &quot;NY&quot;, &quot;NC&quot;, &quot;ND&quot;,
               &quot;OH&quot;, &quot;OK&quot;, &quot;OR&quot;, &quot;PA&quot;, &quot;RI&quot;, &quot;SC&quot;, &quot;SD&quot;, &quot;TN&quot;, &quot;TX&quot;, &quot;UT&quot;, &quot;VT&quot;, &quot;VA&quot;, &quot;WV&quot;, &quot;WA&quot;, &quot;WI&quot;, &quot;WY&quot;]
  colors = [8.0, 3.0, 11.0, 5.0, 61.0, 9.0, 6.0, 3.0, 3.0, 33.0, 17.0, 3.0, 3.0, 20.0, 11.0, 5.0, 5.0, 7.0, 8.0, 3.0,
            10.0, 11.0, 16.0, 9.0, 5.0, 10.0, 3.0, 3.0, 5.0, 3.0, 14.0, 4.0, 31.0, 16.0, 3.0, 19.0, 7.0, 7.0, 20.0, 3.0,
            8.0, 3.0, 11.0, 44.0, 5.0, 3.0, 14.0, 12.0, 3.0, 9.0, 3.0]
  
  
  fig = go.Figure(data=go.Choropleth(locations=locations, locationmode=&quot;USA-states&quot;, z=colors, colorscale=&quot;Reds&quot;))
  
  fig.update_layout(
      geo = dict(
          scope='usa',
          projection=go.layout.geo.Projection(type = 'albers usa')))
  fig.show()
  </code></pre>
  <p>My problem is that I'm not able to write the number of electors on each state (I know that the color indicate the number of electors but it is a requirement that the number of elector must be written on each state)</p>
  <p>Does someone know how I can write the number of electors on each state ? Thank you !</p>