Smooth line with spline + datetime objects doesn't work
问题 I have been trying to make a plot smoother like it is done here, but my Xs are datetime objects that are not compatible with linspace.. I convert the Xs to matplotlib dates: Xnew = matplotlib.dates.date2num(X) X_smooth = np.linspace(Xnew.min(), Xnew.max(), 10) Y_smooth = spline(Xnew, Y, X_smooth) But then I get an empty plot, as my Y_smooth is [ 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. ] for some unknown reason. How can I make this work? EDIT Here's what I get when I print the variables, I see nothing