title: Python Folium Choropleth Map - Legend Quantiles Overlap
body: <p>I am struggling to solve a problem I am having with folium choropleth map. I am visualizing COVID-19 cases and try to plot the colour according to their quantiles affiliation. However, unfortunately, the legend overlaps. Hence, I am wondering if someone could please tell me how to fix this problem? Either by "logarithmically" scaling the legend or just showing the start and end. Unfortunately, I did not find sufficient advice online. Please find below the code and a visualization:</p>
  
  <pre><code>myscale = (covid_cases['total_cases'].quantile((0,0.02,0.25,0.5,0.75,0.9,0.98,1))).tolist()
  
  m = folium.Map([10, -10], zoom_start= 2)
  
  folium.Choropleth(
      geo_data = world_countries,
      data = covid_cases,
      columns = ['code','total_cases'],
      nan_fill_color = 'gray',
      nan_fill_opacity = 0.20,
      key_on = 'feature.id',
      fill_color='YlGnBu',
      threshold_scale=myscale,
      fill_opacity=0.7,
      line_opacity=1.0,
      legend_name='COVID-19 Total Cases per Country | Data Source: OurWorldInData (own repr.)',
  ).add_to(m)
  
  
  m.save(os.path.join('/Users/XXX/Results', 'covid_cases.html'))
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/zjHMm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zjHMm.png" alt="Overlapping legend"></a></p>
  
  <p>Thank you in advance!</p>