Gibberish / malformed negative y-axis values in plotly charts in python

Im trying to plot a bar plot in plotly that is representing net-gains (will have positive and negative bar values). But somewhat the negative values in the y-axis are being represented in gibberish. I tried several things, including using update_layout function, but nothing seems to work. Im using the make_subplots function because i want to plot multiple viz on one figure.

Im using databricks for this code.
Attaching my code and viz output:

net_gains = pd.DataFrame()
net_gains["general_net_gain"] = [-2,2,-1,2]


fig = plotly.subplots.make_subplots(rows=1, cols=1)
fig.add_bar(x=net_gains.index, y=net_gains["general_net_gain"], row=1, col=1)
fig.update_layout(height=400,width=500,showlegend=True)

[![Viz output][1]][1]

Screen Shot 2023-01-25 at 14.46.44

HI @harrykane welcome to the forums.

I can’t reproduce this and never have seen this before. Did you find a way to solve it?

Hi, seems that you are not the only one with this issue:

Which plotly version are you using?

@adamschroeder

@adamschroeder im using 5.12.0 plotly version

hi @harrykane
I’m not able to recreate your issue either. I’m using plotly 5.12.0, and I’ve tried this code:

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

fig = plotly.subplots.make_subplots(rows=1, cols=1)

fig.add_bar(x=[1, 2, 3], y=[-4, 5, -6],
    row=1, col=1
)

fig.update_layout(height=600, width=800)
fig.show()

which makes this:

I’ve also tried this code:

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

fig = make_subplots(rows=1, cols=2)

fig.add_trace(
    go.Scatter(x=[1, 2, 3], y=[-4, 5, -6]),
    row=1, col=1
)

fig.add_trace(
    go.Scatter(x=[20, 30, 40], y=[50, -60, 70]),
    row=1, col=2
)

fig.update_layout(height=600, width=800, title_text="Side By Side Subplots")
fig.show()

Can you please share a sample of your data and full code that was used to create the problematic charts.