I want to make a bar graph showing first the result of the past three years, then the months of the current year.
Is it possible to change/width the colour of the bar when the x-axis value is in a year format?
import pandas as pd
import plotly.express as px
dates = [β2020β, β2021β, β2022β, β2023-01β,β2023-02β]
amounts = [1000, 950, 1150, 80,8]
df = pd.DataFrame({βDateβ: dates, βAmountβ: amounts})
fig = px.bar(df, x=df.Date, y=[βAmountβ],title=ββ,barmode=βgroupβ)
fig.show()