☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

bokeh timeseries plot : how to format x axis?

Community Support
karim.bernardet
karim.bernardet

I am using bokeh (TimeSeries) to generate plots with Django and I do not manage to format time on the x axis :

data2 = dict(depth=Y2['depth'],date=X2['date'])
plot = TimeSeries(data2, title="test", xscale='datetime', xlabel = 'time' , ylabel='depth')
script, div = components(plot, CDN)

return render(request, "simple_chart3.html", {"the_script": script, "the_div": div})

X2[‘date’] is an array of datetime.

I get the following plot

Depth versus time

How to format the x axis ?

Thanks for any hint

Karim

⌁   Link to post
Bryan
Bryan

Timeseries should format its axis nicely by default. Maybe you've run into a bug of some sort, but it's impossible to speculate without being able to see and run complete code. Can you provide a complete, minimal, runnable example to reproduce what you are seeing? In anycase there is a large section on formatting axes in the user's guide:

  Appearance — Bokeh 3.3.2 Documentation

Thanks,

Bryan

···

On Oct 21, 2016, at 10:05 AM, karim.bernardet@gmail.com wrote:

I am using bokeh (TimeSeries) to generate plots with Django and I do not manage to format time on the x axis :

data2 = dict(depth=Y2['depth'],date=X2['date'])

plot
= TimeSeries(data2, title="test", xscale='datetime', xlabel = 'time' , ylabel='depth')

script
, div = components(plot, CDN)

return render(request, "simple_chart3.html", {"the_script": script, "the_div": div})
X2['date'] is an array of datetime.

I get the following plot

Depth versus time

How to format the x axis ?

Thanks for any hint

Karim

--
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 bokeh+unsubscribe@continuum.io.
To post to this group, send email to bokeh@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/10f9d8c5-fa32-49fb-8bb9-702826ed3df9%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

⌁   Link to post

End of archived discussion · Replies are disabled