The following code draws the cdf for datetime values:
import matplotlib.pyplot as plt
import matplotlib.dates as dates
import numpy as np; np.random.seed(42)
import pandas as pd
objDate = dates.num2date(np.random.normal(735700, 300, 700))
ser = pd.Series(objDate)
ax = ser.hist(cumulative=True, density=1, bins=500, histtype='step')
plt.show()
How can I remove the vertical line at the right-most end of graph? The approach mentioned here doesn't work as replacing line#9 with:
ax = ser.hist(cumulative=True, density=1, bins=sorted(objDate)+[np.inf], histtype='step')
gives
TypeError: can't compare datetime.datetime to float