I'm trying to figure out if there's a simple way to have Plotly default to ISO week start (weeks start Monday rather than Sunday). I have a simple bar chart with a datetime x-axes, data is in weekly "buckets". The issue is, even though my data is grouped by Monday dates, Plotly automatically labels x-axis ticks with Sunday dates (so, in my data frame records are labeled as 8/3, 8/10, 8/17 etc, Plotly labels my axis as 8/2, 8/9, 8/16).
Here's a simplified example:
import pandas as pd
import datetime as dt
import plotly.express as px
weeks = [dt.date(2020, 8, 3) + dt.timedelta(days=7*x) for x in range(0,5)]
nums = [3, 2, 5, 7, 3]
df = pd.DataFrame([weeks, nums]).T
df.columns = ['weeks', 'nums']
fig = px.bar(df, 'weeks', 'nums')
fig.show()
When I run the above code, Plotly automatically labels the x-axis with Sunday dates. Thanks in advance for any suggestions.