Modify marker size in legend?


Hi there,

I have a quick and simple question which I couldn’t figure out myself.

Is there a way to modify how the legend displays the markers?
At the moment I am using scattergl with thousands of small points per trace…so I had to set the marker size small, which looks nice within the scatter plot but not in the legends where the markers colors are not distinguishable.

Similar thing: I wanted to color my points, using one color for the filling and one for the outline (the outline would indicate the point’s trace and is hence the only color I would like to display in the legend which displays the scatter traces. Does that work?

I would appreciate your help.


Not at the moment unfortunately.


I’m picking up that topic again, as one thing crossed my mind so I was playing around but no success yet.

Note that I am using the scattergl plot type.
I am wondering if there is a way to use the legendgroup behavior to accomplish different marker styles in my legend?
I tried creating my regular traces as scattergl plus additional “fake traces” in “box” type, which look nice in the legend, linked using the same legendgroup.
I thought by doing so, I could somehow use the box layout in the legend, while my scatter cointains the scattergl traces.
However, it always screws up my axes.

Am I missing something or is it just not possible?
Best regards,


That’s another gl2d limitation. You can’t currently mixed gl2d traces with regular cartesian traces (e.g. box trace). So yeah, that probably messed up the axes.


By the way @silly_lily, you might want to subscribe to for the latest info on our gl2d rewrite. We’re hoping to bring scattergl and gl2d axes to par with cartesian at some point this fall.



was there any improvements in that direction?



Still no way to set a legend marker size in Plotly… imagine a scatter plot with 5000 points…
either giant markers in the plot, or microscopic legend dots… Is there still no simple solution for this? I simple legend(markersize = x) argument sounds so simple to add.

p.s. i’m using plotly in R


Hi !
Have you found something ?
I have the same issue in Python.