Error bars in px.scatter should inherit color and opacity from markers by default
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 18.8k
- Forks
- 2.8k
- Merge medio
- 16 h 26 min
- PR fusionados (30 d)
- 21
Descripción
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.
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza con las reproducciones proporcionadas de px.scatter usando valores de color categóricos y numéricos, con y sin opacidad. Inspecciona la configuración generada de las barras de error y los marcadores para identificar dónde difieren su color y opacidad. Se considera terminado cuando las barras de error heredan de forma predeterminada el color y la opacidad del marcador en todos los casos mostrados, con cobertura para las reproducciones.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- data-visualization
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bien especificado
- Aptitud para principiantes
- 45/100