Skip to content

Probleme with date label when i try to export plotly graphΒ #361

@Jacques2101

Description

@Jacques2101

Hi

when i try to generate this toy data i have the date that are (huge) number and not date whereas it should be...
I tried many thinks to change this point but no way, it was impossible!
Any help would be helpful

I am using :

  • Plotly 6.2.0
  • Kaleido 1.0.0
  • Python 3.13.5
import pandas as pd

import numpy as np
import plotly.express as px

# Generation of df 
dates = pd.date_range(start="2020-01-01", periods=3 * 365, freq="D")
values = np.random.normal(loc=0, scale=1, size=len(dates)).cumsum()
df = pd.DataFrame(values, index=dates)

# Graph exportation 
fig = px.line(df, x=df.index, y= df.columns[0], )
fig = px.line(df, x=df.index, y=df.columns[0])
fig.write_image('graphique_test.png', width=800, height=500)  

Here is the graph :

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2needed for current cyclebugsomething brokenregressionthis used to work

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions