Home > Software engineering >  plotly express shows mid of the day marks that are not in the dataframe, how to fix?
plotly express shows mid of the day marks that are not in the dataframe, how to fix?

Time:12-08

how not to show mid of the 12pm on the chard. I want days only. Here is the dataset from the chart enter image description here

CodePudding user response:

Looks like you are trying to update the "x-tick" labels. The plotly documentation has some information on how to do this (https://plotly.com/python/tick-formatting/)

Something like

fig.update_layout(
   xaxis_tickformat = '%b %d %Y',
)

should format the x-ticks as month (%b), day (%d), year (%Y).

You can see more information on formatting options here (https://github.com/d3/d3-time-format/blob/main/README.md)

  • Related