plotly / plotly/plotly.py

Error bars in px.scatter should inherit color and opacity from markers by default

Aberta
#4,353 1 comentário 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

bug P3
Linguagem predominante
Python
Estrelas
18.8k
Forks
2.8k
Merge médio
16h 26min
PRs com merge (30d)
21

Descrição

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()
image

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()
image

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()
image

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.

Guia de contribuição

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Direção de pesquisa

Comece com as reproduções fornecidas de px.scatter usando valores de cor categóricos e numéricos, com e sem opacidade. Inspecione as configurações geradas das barras de erro e dos marcadores para identificar onde a cor e a opacidade deles divergem. Considera-se concluído quando as barras de erro herdarem, por padrão, a cor e a opacidade do marcador em todos os casos mostrados, com cobertura para as reproduções.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
python
Domínio
data-visualization
Tipo de issue
Bug
Dificuldade
3/5
Tempo estimado
1-2 dias
Status de atividade
Estagnada
Clareza
Claramente especificada
Facilidade para iniciantes
45/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.