Pandas DataFrame and Bokeh TimeSeries

Hi,

I am trying to use Pandas DataFrame with DateTimeIndex together with Bokeh TimeSeries. Everything looks good but I cannot display full date, only time.

print df.index
<class ‘pandas.tseries.index.DatetimeIndex’>
[2015-03-10 11:50:32, …, 2015-03-10 14:32:51]

p = TimeSeries(df, xlabel=‘Time’, ylabel=‘Values’, width=800, height=400,legend=“top_left”)

Any help would be much appreciated.

You probably need to update the xaxis formatter with custom one.

See: http://bokeh.pydata.org/en/latest/docs/user_guide/styling.html#tick-label-formats

p = TimeSeries(df, xlabel=‘Time’, ylabel=‘Values’, width=800, height=400,legend=“top_left”)
p.xaxis[0].formatter = DatetimeTickFormatter(formats=dict(months=["%b %Y"]))

You’ll probably need to look up the documentation for DatetimTickFormatter - http://bokeh.pydata.org/en/latest/docs/reference/models.html#bokeh.models.formatters.DatetimeTickFormatter

···

On Tue, Jun 30, 2015 at 3:26 PM, Mateusz Olszowy [email protected] wrote:

Hi,

I am trying to use Pandas DataFrame with DateTimeIndex together with Bokeh TimeSeries. Everything looks good but I cannot display full date, only time.

print df.index
<class ‘pandas.tseries.index.DatetimeIndex’>
[2015-03-10 11:50:32, …, 2015-03-10 14:32:51]

p = TimeSeries(df, xlabel=‘Time’, ylabel=‘Values’, width=800, height=400,legend=“top_left”)

Any help would be much appreciated.

You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.

To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

To post to this group, send email to [email protected].

To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/165f7baf-5117-4de5-bcc0-f6b0304cb49b%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.