Error bars in px.scatter should inherit color and opacity from markers by default
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 18.8k
- Fork
- 2.8k
- Merge medio
- 16h 26m
- PR unite (30g)
- 21
Descrizione
Error bars do correctly show with the same color (not opacity) as markers when using categorical data to set the color parameter:
import plotly.express as px
df = px.data.iris()
df["e_plus"] = df["sepal_width"]/100
df["e_minus"] = df["sepal_width"]/40
fig = px.scatter(df, x="sepal_width", y="sepal_length", color="species",
error_y="e_plus", error_y_minus="e_minus")
fig.show()
However, setting the opacity parameter only changes the opacity of the markers:
fig = px.scatter(df, x="sepal_width", y="sepal_length", color="species",
error_y="e_plus", error_y_minus="e_minus", opacity=0.6)
fig.show()
And using numerical data to set the color parameter, the error bars will not have the same color as the markers, but instead renders in black:
fig = px.scatter(df, x="sepal_width", y="sepal_length", color="petal_width",
error_y="e_plus", error_y_minus="e_minus")
fig.show()
Fixing this would be super helpful, since the only current solution seems to be to manually add or update the trace for every single data point to set rgba-values for the error bars. My scatter plot had a few thousand data points, making that a very time consuming for-loop.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia con le riproduzioni fornite di px.scatter usando valori di colore categoriali e numerici, con e senza opacità. Ispeziona le impostazioni generate delle barre di errore e dei marker per identificare dove il loro colore e la loro opacità divergono. Il lavoro è completato quando le barre di errore ereditano per impostazione predefinita il colore e l’opacità del marker in tutti i casi mostrati, con una copertura delle riproduzioni.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- data-visualization
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 45/100