And this does indeed add an axis with the dates specified accordingly however I now have two axis, one with numbers and one with dates! Instead of adding an axis I want to simply specify a formatter for an existing axis.
In [2]: output_file("/tmp/foo.html")
Session output file '/tmp/foo.html' already exists, will be overwritten.
In [3]: line([1,2,3], [4,5,6])
Out[3]: <bokeh.objects.Plot at 0x110fe3d50>
In [4]: xaxis()[0].formatter
Out[4]: <bokeh.objects.BasicTickFormatter at 0x110fe3e90>
This is a BasicTickFormatter, but the principle is the same. So you could replace the formatter with an entirely new one, or set the months attribute of an existing formatter, etc.
And this does indeed add an axis with the dates specified accordingly however I now have two axis, one with numbers and one with dates! Instead of adding an axis I want to simply specify a formatter for an existing axis.
Thanks for the quick reply! That’s very useful to know, so much so that I’d suggest that it’s a worthy addition to the TimeSeries demo.
Thanks,
Dave
···
On Wednesday, 24 September 2014 15:51:37 UTC+1, Bryan Van de ven wrote:
You can pull the formatter off an existing axis:
In [1]: from bokeh.plotting import *
In [2]: output_file(“/tmp/foo.html”)
Session output file ‘/tmp/foo.html’ already exists, will be overwritten.
In [3]: line([1,2,3], [4,5,6])
Out[3]: <bokeh.objects.Plot at 0x110fe3d50>
In [4]: xaxis()[0].formatter
Out[4]: <bokeh.objects.BasicTickFormatter at 0x110fe3e90>
This is a BasicTickFormatter, but the principle is the same. So you could replace the formatter with an entirely new one, or set the months attribute of an existing formatter, etc.
And this does indeed add an axis with the dates specified accordingly however I now have two axis, one with numbers and one with dates! Instead of adding an axis I want to simply specify a formatter for an existing axis.