Bug reportOct 8, 2026· 0:21· 0 views
Plotly.js 4.1.2: yaxis.automargin 'right+top+bottom' clips right-side tick labels
0:21 total
Comments · 0
Be the first to comment.
Bug report— by SceneRecap AI
mediumlayout / margin calculation / automargin parser
os: macOSbrowser: Chromium 151.0.7922.34viewport: 1280x720plotly.js: 4.1.2
Repro steps
- 1.Create a Plotly plot with a right-aligned or right-side y-axis containing tick labels (e.g. 1000, 2000, 3000).
- 2.Set yaxis automargin property to the directional string value 'right+top+bottom'.
- 3.Render the chart and inspect the computed right margin and tick label visibility.
Expected
Specifying yaxis.automargin: 'right+top+bottom' should compute sufficient margin (e.g. rightMargin=32 px as seen in the control case) so that right-side tick labels are fully visible.
Actual
yaxis.automargin: 'right+top+bottom' calculates rightMargin=0 px, clipping all right-side tick labels from view.
Evidence
visualAt 1.0s, the Control chart with automargin: true displays right-side y-axis tick labels (1000, 1500, 2000, 2500, 3000) with rightMargin=32 px. In contrast, the Failure chart with automargin: 'right+top+bottom' shows rightMargin=0 px and completely clipped tick labels.
visualBottom telemetry panel displays 'Control - rightMargin=32 px (push=[object Object], anchor=(none))' vs 'Failure - rightMargin=0 px (push=[object Object], anchor=(none))'.
Issue markdown (copy-paste ready)
### Summary In Plotly.js 4.1.2, setting `yaxis.automargin` to the directional string `'right+top+bottom'` results in `rightMargin` evaluating to `0 px` instead of calculating spacing for right-side y-axis tick labels. As a result, right-side tick labels are clipped and invisible. ### Steps to Reproduce 1. Render a line chart in Plotly.js with right-side y-axis tick labels (1000, 2000, 3000). 2. Set `yaxis.automargin` to `'right+top+bottom'`. 3. Observe the rendered margin and label visibility. ### Expected Result Directional automargin should include the right margin calculation (`rightMargin = 32 px`), matching the behavior of `automargin: true`. ### Actual Result `rightMargin` is calculated as `0 px`, causing all right-side tick labels to be clipped. ### Evidence - **Control (`automargin: true`)**: Right-side tick labels visible, `rightMargin=32 px`. - **Failure (`automargin: 'right+top+bottom'`)**: Tick labels clipped/invisible, `rightMargin=0 px`. *Recorded with SceneRecap.*
Your recordings could explain themselves too.
Free plan · silent recordings welcome · bug reports included.
Try SceneRecap free →