Skip to content

Setting multiple marker colors on box plot #2308

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
palimondo opened this issue Jan 30, 2018 · 7 comments
Closed

Setting multiple marker colors on box plot #2308

palimondo opened this issue Jan 30, 2018 · 7 comments
Labels
feature something new

Comments

@palimondo
Copy link

palimondo commented Jan 30, 2018

According to Plotly’s Javascript documentation, it should be possible to set multiple colors for markers in box plot:

Sets the marker.line color. It accepts either a specific color or an array of numbers that are mapped to the colorscale relative to the max and min values of the array or relative to cmin and cmax if set.

It doesn’t appear to work. Setting marker.color to Array results in default color being used, as this codepen demonstrates: https://codepen.io/palimondo/pen/qxEaKo

@etpinard
Copy link
Contributor

Oh that description is wrong. Thanks for pointing this out.

We don't allow per-point marker settings on box traces at the moment.

@palimondo
Copy link
Author

palimondo commented Jan 30, 2018

@etpinard Is there a way to work around this limitation? I have tried mixing box and scatter traces in a plot and it sort of works, but they are interacting strangely. I can get the scatter to draw over the box plot if my secondary coordinate is not set or set to a constant. But as soon as I use array of values the scatter doesn’t appear to be respecting the secondary coordinate and the values get randomly distributed between the two box plots, but they also partially overlap them. I’m going for box points simulation withpointpos and jitter, so I need to control it somehow. Also the 0th scatter trace never merges with 0th box plot for some reason…
(I’m sorry, as this is probably not the right place to discuss this.)

@etpinard
Copy link
Contributor

Is there a way to work around this limitation?

You should be able to get the desired result using a scatter trace. You'll have to generate your own jitter, as we don't allow jitter settings in scatter traces at the moment (see #299). By looking through https://community.plot.ly/, you might examples that might help you out.

@palimondo
Copy link
Author

palimondo commented Jan 30, 2018

@etpinard I had trouble mixing scatter and box plots together. I’ve posted the codepens with problem and eventual solution to the community forum.

@le01phuo
Copy link

A simpler version, where you can highlight several points by the attribute: 'selectedpoints' of box.

https://community.plot.ly/t/color-a-group-of-individual-points-in-boxplot/10432

@ahmedhosny
Copy link

Any activity on this front? It seems the "selectedpoints" attribute only allows for one subgroup.

@gvwilson
Copy link
Contributor

Hi - this issue has been sitting for a while, so as part of our effort to tidy up our public repositories I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our stack. Cheers - @gvwilson

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature something new
Projects
None yet
Development

No branches or pull requests

5 participants