plotly / plotly/plotly.py

Colorbar is not showing last tick

Offen
#5,066 2 Kommentare 6 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

bug P2
Vorherrschende Sprache
Python
Sterne
18.8k
Forks
2.8k
Ø Merge
16 Std. 26 Min.
Gemergte PRs (30 T.)
21

Beschreibung

Hi,
I have added a horizontal colorbar to a heatmap figure and can't get the last tick to show. Here are some of things I tried and thought are the most logical:

colorbar= dict(
            orientation='h',
            y=1.01,
            tickformat=".0%",
            tickmode='array',
            tickvals=[0, 0.25, 0.5, 0.75, 1],
            showticksuffix='last',
            ), 

and

colorbar= dict(
            orientation='h',
            y=1.01,
            tickformat=".0%",
            tickmode='linear',
            tick0=0,
            dtick=0.25,
            nticks=5,
            ticklabeloverflow="allow",
            ), 

but both yield the same result:
Image

I have also tried moving the bar around the x axis and played with labels and length, but it always seems missing.

Is this a bug?

Plotly: 5.24.1 and Python: 3.12.7

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Reproduzieren Sie die horizontale Heatmap-colorbar mit den bereitgestellten Konfigurationen tickmode='array' und tickmode='linear' unter Verwendung von Plotly 5.24.1 und Python 3.12.7. Verfolgen Sie, wie die colorbar den letzten Tick verarbeitet, und überprüfen Sie die Korrektur, indem Sie bestätigen, dass das Tick-Label 1.0 gerendert wird, ohne die anderen Labels zu beeinflussen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
data-visualization
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.