File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -1828,14 +1828,16 @@ def cycle_changer(
18281828 # Step size for grouped bar plots
18291829 # WARNING: This will fail for non-numeric non-datetime64 singleton
18301830 # datatypes but this is good enough for vast majority of most cases.
1831- x_step = np .atleast_1d (_to_ndarray (x ))
1832- if len (x_step ) >= 2 :
1833- x_step = x_step [1 :] - x_step [:- 1 ]
1831+ x_test = np .atleast_1d (_to_ndarray (x ))
1832+ if len (x_test ) >= 2 :
1833+ x_step = x_test [1 :] - x_test [:- 1 ]
18341834 x_step = np .concatenate ((x_step , x_step [- 1 :]))
1835- elif x_step .dtype == np .datetime64 :
1835+ elif x_test .dtype == np .datetime64 :
18361836 x_step = np .timedelta64 (1 , 'D' )
18371837 else :
1838- x_step = 0.5
1838+ x_step = np .array (0.5 )
1839+ if np .issubdtype (x_test .dtype , np .datetime64 ):
1840+ x_step = x_step .astype ('timedelta64[ns]' ) # avoid int timedelta truncation
18391841
18401842 # Get x coordinates for bar plot
18411843 x_col , y_first = x , ys [0 ] # samples
You can’t perform that action at this time.
0 commit comments