I am trying to analyse previous market corrections and found a dataset with a date format year.month (ex: 2021.11 for this month) and other data including the price at the given date. I imported it via pandas and made it into a pandas dataframe, subsetting the date and the price.
When I use the code below to plot the data I get a result where the plot goes up horinzontally with random indentations where there shouldn´t be one.
import plotly.graph_objects as go
import pandas as pd
fig = go.Figure([go.Scatter(x=analysedata['Date'], y=analysedata['P'])])
fig.update_xaxes(
rangeslider_visible=True,
rangeselector=dict(
buttons=list([
dict(count=1, label="1m", step="month",
stepmode="backward"),
dict(count=6, label="6m", step="month",
stepmode="backward"),
dict(count=1, label="YTD", step="year",
stepmode="todate"),
dict(count=1, label="1y", step="year",
stepmode="backward"),
dict(step="all")
])
)
)
fig.show()