Objective: I want to have tick marks on the x axis only on 2017/10/2 and 2017/10/5. One constraint is that my times are not guaranteed to be evenly separated, so converting
Converting pandas Timestamps to integers gives nanoseconds. So dividing by 10^6 to get milliseconds works for me:
y = list(range(3))
x = pd.to_datetime(['2017-10-01', '2017-10-09', '2017-10-10'])
tick_vals = pd.to_datetime(['2017-10-02', '2017-10-05']).astype(int) /
10**6
fig = figure(x_axis_type='datetime')
fig.line(x, y)
fig.xaxis.ticker = FixedTicker(ticks=list(tick_vals))
show(fig)