plotly / plotly/plotly.py

Axis formatting not carrying over to hover text in shared axes

Ouverte
#2,740 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

bug P3
Langage dominant
Python
Étoiles
18.8k
Forks
2.8k
Merge moyen
16 h 26 min
PR mergées (30 j)
21

Description

The code below produces subplots with shared Y axes (on the top row), then attempts to apply y axis formatting to display values in percentages. However, when hovering over the data points in the top right plot, I'm still seeing the default format instead of percentages. Wondering if that's intended, as I feel like the default behavior should be to apply the formatting to all the subplots with that shared axis.

from plotly.subplots import make_subplots
import plotly.graph_objects as go

fig = make_subplots(rows=2, cols=2,
                        specs=[[{}, {}],
                               [{"colspan": 2}, None]],
                        subplot_titles=("1", "2", "3"),
                        shared_yaxes=True,
                        horizontal_spacing=0.01,
                        vertical_spacing=0.15)

fig.add_trace(go.Scatter(x=[1,2], y=[0,1]),
                      row=1, col=1)

fig.add_trace(go.Scatter(x=[1,2], y=[0,1]),
                      row=2, col=1)

fig.add_trace(go.Scatter(x=[1,2], y=[0,1]),
                      row=1, col=2)

fig.update_yaxes(tickformat=',.1%')

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par la reproduction Python fournie en utilisant make_subplots, shared_yaxes et update_yaxes, puis examinez comment y-axis tickformat est appliqué aux sous-graphiques partagés et aux libellés au survol. Le travail est considéré comme terminé lorsque les valeurs au survol du sous-graphique en haut à droite utilisent systématiquement le format de pourcentage demandé pour l’axe partagé.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
python
Domaine
data-visualization
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.