plotly.py icon indicating copy to clipboard operation
plotly.py copied to clipboard

different behavior for `.show()` and `.write_image()` with `ticksuffix`/`tickprefix`

Open StephaneBranly opened this issue 1 year ago • 0 comments

I noticied two different behavior while using (ticksuffix or tickprefix) and tickvals parameter to update an axis when I want to display or save the graph.

Plotly version : 5.22.0

Reproduction code :

import plotly.graph_objects as go
fig = go.Figure(
    data=[go.Bar(x=[1,2], y=[2,3]),],
    layout=dict(xaxis=dict(tickvals=[1,2],tickprefix='a', ticksuffix='b'))
)
fig.show()
fig.write_image(f"graphs/test.png", format="png")

.show() output : image

.write_image() output : test

StephaneBranly avatar Jul 18 '24 14:07 StephaneBranly