1

I have made a plot using plotly express line. Now I want to edit the x axis ticks, so that they are 1st day of every month, meaning I would get 1 Jan 1 Feb 1 Mar 1 Apr. How can I achieve that? I was trying with

fig = px.line(df, x='date',y='value',color='transportation')

fig.update_layout(
    xaxis_tickformat = '%d %b',
    xaxis=dict(
                tickmode = 'array',
                tickvals = ['2020-02-01'],
                ticktext = ['1 Feb'])

enter image description here

But tickvals and ticktext do not change.

szczor1
  • 191
  • 1
  • 2
  • 12
  • [Enumerated Ticks with Tickvals and Ticktext](https://plotly.com/python/axes/)You may find this official reference helpful. Specify a list of dates and names to be displayed. – r-beginners Apr 30 '20 at 15:13
  • 1
    `How can I achieve that?` - look through the documentation, do some searches, apply what you learned. Welcome to SO. This isn't a discussion forum or tutorial. Please take the [tour] and take the time to read [ask] and the other links found on that page. – wwii Apr 30 '20 at 15:20
  • 2
    Does this answer your question? [Plotly: How to set values for major ticks / gridlines for x-axis?](https://stackoverflow.com/questions/55160390/plotly-how-to-set-values-for-major-ticks-gridlines-for-x-axis) – wwii Apr 30 '20 at 15:21

0 Answers0