✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
🐇 Announcing Dash VTK for 3d simulation graphics. Check out the March webinar.

Wrong spacing for dates on xaxis

Screenshot

So the spacing is wont for the xaxis: x values are 1 month apart for the first 6 elements and then 3 months apart. I tried reformatting multiples times:
I used this:
<class 'datetime.datetime>
[datetime.datetime(2018, 10, 17, 0, 0), datetime.datetime(2018, 11, 21, 0, 0), datetime.dat
etime(2018, 12, 19, 0, 0), datetime.datetime(2019, 1, 16, 0, 0), datetime.datetime(2019, 2,
20, 0, 0), datetime.datetime(2019, 3, 20, 0, 0), datetime.datetime(2019, 6, 19, 0, 0), dat
etime.datetime(2019, 9, 18, 0, 0), datetime.datetime(2019, 12, 18, 0, 0), datetime.datetime
(2020, 3, 18, 0, 0)]
and this:
<;class ‘str’>
[‘2018-10-17’, ‘2018-11-21’, ‘2018-12-19’, ‘2019-01-16’, ‘2019-02-20’, ‘2019-03-20’, ‘2019-
06-19’, ‘2019-09-18’, ‘2019-12-18’, ‘2020-03-18’]
and this:
<;class ‘pandas._libs.tslibs.timestamps.Timestamp’>
DatetimeIndex([‘2018-10-17’, ‘2018-11-21’, ‘2018-12-19’, ‘2019-01-16’,
              ‘2019-02-20’, ‘2019-03-20’, ‘2019-06-19’, ‘2019-09-18’,
              ‘2019-12-18’, ‘2020-03-18’],
             dtype=‘datetime64[ns]’, freq=None)

and they all give the same output. Does anyone have an idea of how to solve this? i.e having a larger spacing in between the last 4 values?

Problem solved: I had a type=“category” on layout < xaxis

1 Like

+1 for returning to the forum and writing your solution good sir!