plotly / plotly/plotly.py

with v6.3.0 the last y-axis label is cut off when top-margin is 0

Offen
#5,337 1 Kommentar 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

@camdecoster arbeitet bereits daran.

Seit 09.9.2025.

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

Beschreibung

There seems to be a breaking change between 6.2.0 and 6.3.0. When setting the top-margin to 0 the y-axis label is cut off when it is right at the end of the axis.

You can reproduce this with this code.

import plotly.graph_objects as go
from datetime import datetime

x = [datetime(1912, 5, 6, 0, 0), datetime(2019, 5, 10, 0, 0)]
y = [7.6, 23.9]

fig = go.Figure()
fig.add_trace(go.Scatter(x=x, y=y, mode='markers'))
fig.add_trace(go.Scatter(x=[datetime(2025, 9, 1)], y=[5.9]))
fig.update_layout(
    template='simple_white',
    margin={'l': 10, 'r': 10, 't': 0, 'b': 10},
)
fig.write_image(file='t.jpeg')

The result differs between version. Since the tick itself is there, but the label is missing I feel this is a bug. Also margins should not control the plot itself and decide whether or not labels are drawn.

plotly==6.2.0 plotly==6.3.0
Image Image

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.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

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