Skip to content

px.box() Change symbol marker #4371

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
blu3ser opened this issue Oct 1, 2023 · 5 comments
Closed

px.box() Change symbol marker #4371

blu3ser opened this issue Oct 1, 2023 · 5 comments

Comments

@blu3ser
Copy link

blu3ser commented Oct 1, 2023

Hi, I am trying to change the type of symbols that px.box plots when I pass the points='all'. Is there any way to change the symbol type for each data?

Something like:

fig = px.box(df,
x='Class',
y='Range',
color='Version',
title='Dispersion Data',
hover_data=['Result'],
points='all',
symbol='MarkerSymbol')
)

where MarkerSymbols contains: 'circle-open' or 'x-thin'

Thank you

@AniketP04
Copy link

Hey @blu3ser, just go through this link. I hope this will resolve your issues.

@blu3ser
Copy link
Author

blu3ser commented Oct 8, 2023

Hi @AniketP04

Thank you for the answer, but I can't find anything to help me, I don't know if I have expressed myself correctly, I put an example to illustrate it.

I have a dataframe with 3 columns. Name, Range and Class.

When creating a px.box to see the dispersion of the column Range, I would like that for the Class column, I can choose the type of symbols that are represented when I select the allpoints. That is to say
Name, Rank, Class
Item#1, 10, circle
Item#2, 5, square
Item#3,20, circle

So, I can assign every class a distinct symbol, something similar to what color_discrete_map do with px.bar for example

Thank you

@alexcjohnson
Copy link
Collaborator

@blu3ser no, I'm afraid we don't have a way right now to give each point a different symbol (or any other attribute for that matter, such as size or color). This would need to be a feature request for plotly.js. You could maybe work around this by hiding all points and then adding the points in a scatter trace - but that also doesn't give quite the right result because it won't jitter the points horizontally (a highly-requested feature on its own but hasn't made it to the top of our list plotly/plotly.js#299)

@blu3ser
Copy link
Author

blu3ser commented Oct 11, 2023

Hi @alexcjohnson thank you for your answer, no problem, I'll try to be more creative ;)

Thank you

@gvwilson
Copy link
Contributor

Hi - we are tidying up stale issues and PRs in Plotly's public repositories so that we can focus on things that are still important to our community. Since this one has been sitting for a while, I'm going to close it; if it is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. If you'd like to submit a PR, we'd be happy to prioritize a review, and if it's a request for tech support, please post in our community forum. Thank you - @gvwilson

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

No branches or pull requests

4 participants