I'm using bokeh with an ipython notebook.
I want to plot a line graph in bokeh using a pandas DataFrame containing datetimes:
import pandas as pd from datetime import datetime as dt from bokeh.io import output_notebook from bokeh.charts import Bar, Line, show df = pd.DataFrame(data=[1,2,3], index=[dt(2015, 1, 1), dt(2015, 1, 2), dt(2015, 1, 3)], columns=['foo']) output_notebook() show(Line(df))
However, bokeh uses microseconds! Why is this? How do I fix it?
The bokeh. plotting API is Bokeh's primary interface, and lets you focus on relating glyphs to data. It automatically assembles plots with default elements such as axes, grids, and tools for you.
As of bokeh 0.12.3, you can now do:
p = figure(..., x_axis_type='datetime', ...)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With