Black Lives Matter. Please consider donating to Black Girls Code today.
Learn how to use COVID-19 data in open source Dash apps. Register for the Sept 23rd webinar with IQT!

Controlling legend circle size in bubble plot

Hi. I’ve been making some (offline) bubble plots using the Python API. I am using bubbles of different sizes. Everything works well, but I cannot see how to control the size of the circles that plotly puts into the legend. The size looks to be determined by the numbers in the size (list) argument I give to the markers. I.e., the size list seems to be controlling two things: the sizes of the individual bubbles in the body of the plot, and also the size of the single bubble in the legend. As I increase the values in the size list, the size of the legend bubble increases proportionally.

In this example, https://plot.ly/python/bubble-charts/#categorical-bubble-charts there are different plot bubble sizes, but the legend bubbles are all the same size. OTOH, on this page http://help.plot.ly/make-a-bubble-chart/ the first chart has differently sized bubbles in the legend in the first plot, but identical sized ones in the legends of the latter plots.

I have plotly version 2.0.1

Can someone tell me how to control this?

Thanks!

This is super frustrating - it appears that plotly uses a heuristic to decide whether to scale the legend marker sizes and there is not an option to turn it off.

Here’s the same issue in the R library - https://stackoverflow.com/questions/40098827/r-plotly-version-4-5-2-scatterplot-legend-bubble-size-settings