Plotly.js: Box legend marker with invisible box but visible points

Created on 6 May 2019  路  13Comments  路  Source: plotly/plotly.js

If I set the box fill and line to 0 opacity but have visible points, the legend entry is invisible. In this case it would be nice to have the legend entry look like the points.

bug

All 13 comments

For context, I'm trying to add strip plots to px:

image

Should we add type: 'strip' traces to plotly.js?

could do, but it's really really easy to emulate with box (or even violin) for now so it's really not a priority, so long as we can slide in a fix for the legend :)

Sure, get a quick legend fix in, but type: 'strip' would be nice at some point - feels awfully hacky to do it via box or violin (instructions: make a box with no box, or a violin with no violin. Take your pick!) and there may be some extra functionality that doesn't make sense in the existing types.

, but type: 'strip' would be nice at some point -

That or adding jitter to scatter traces (cc https://github.com/plotly/plotly.js/issues/299), Personally, I would prefer adding a type: 'strip' trace type.

Right, scatter.jitter is related, but not a replacement for type: 'strip' - especially grouping & offsets on the position axis, but also it's not clear to me if we can (or even if we want to) adjust scatter jitter for the local density of points like we do for box/violin jitter.

Glad you guys are into it! I'm not opposed to a strip type, but I'd still like a fix for the legend in the meantime :)

but I'd still like a fix for the legend in the meantime :)

Yep, that fix will be in 1.48.0

... adjust scatter jitter for the local density of points like we do for box/violin jitter.

I didn't realize we did that but looking at the screenshot above we clearly do, which is cool. It's sort of halfway to "swarm plots"

Seaborn has both but they're quite distinct: https://seaborn.pydata.org/generated/seaborn.swarmplot.html and https://seaborn.pydata.org/generated/seaborn.stripplot.html

Could we imagine an attr that would emulate swarm plots more directly?

@nicolaskruchten maybe you can open a separate issue to discuss strip and/or swarm plots

What we have is already pretty cool as a hybrid... no rush on a new trace type just for this. Next trace type is... drumroll... indicator!

maybe you can open a separate issue to discuss strip and/or swarm plots

What we have is already pretty cool as a hybrid... no rush on a new trace type just for this.

I added it to https://github.com/plotly/plotly.js/issues/2221 in the meantime.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

n-riesco picture n-riesco  路  3Comments

chriddyp picture chriddyp  路  3Comments

danielsamuels picture danielsamuels  路  3Comments

jonmmease picture jonmmease  路  3Comments

maxwell8888 picture maxwell8888  路  3Comments