friends, good afternoon! Can you please tell me how to display 14 months in a row on the barplot chart? Thank you
Hey @papapimok welcome to the forums. Are you refering to something like this?
import pandas as pd
import plotly.express as px
import numpy as np
MONTHS = 14
vals = np.random.randint(2,20,size=MONTHS)
months = pd.Series(pd.date_range("1/1/2023", freq="M", periods=MONTHS))
fig = px.bar(x=months, y=vals)
fig.update_layout({
'xaxis': {
'tickformat': '%y/%m',
'tickvals': months
}
})
creates:
2 Likes