There's nothing built in to Bokeh to do this. You could accomplish something with a custom extension:
from bokeh.models CategoricalTicker
JS_CODE = """
import {CategoricalTicker} from "models/tickers/categorical_ticker"
export class MyTicker extends CategoricalTicker
type: "MyTicker"
get_ticks: (start, end, range, cross_loc) ->
ticks = super(start, end, range, cross_loc)
# drops every other tick -- update to suit your specific needs
ticks.major = ticks.major.filter((element, index) -> index % 2 == 0)
return ticks
"""
class MyTicker(CategoricalTicker):
__implementation__ = JS_CODE
p.xaxis.ticker = MyTicker()
Note that the simple get_ticks
defined above will not handle more complicated situations with nested categories, etc.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…