I have Bokeh histogram plots showing the number of events in duration bins. Basically we're measuring visit durations to a site and they are typically a few minutes, so we've divided the data into 30 second bins labelled like "0:00-0:30", "0:30-1:00", "1:00-1:30" ... etc.
Unfortunately all the labels overlap. I've found rumours tips on how to maybe plot only some of the labels (these are categories but progressive and so it's OK to skip some, like every other one for example).
Now I have found this asked before, numerous times, but the answers all apply to Bokeh versions pre 1.0 and link to pages that are dated and offer solutions that don't work in Bokeh 3. For example:
- How to show only evey nth categorical tickers in Bokeh
- How to specify n-th ticker for bokeh plot from python side, where n is the number of tickers
- Python bokeh show only every second categorical ticker
The tend to link to: http://bokeh.pydata.org/en/latest/docs/user_guide/extensions.html which is not relevant any more.
So I wonder what the Bokeh 3 solution is? Or perhaps there is a non-categorical preference for a histogram binned by durations? Or time of day (I have those too), or month of year, I have those too ... all plotting visit counts in different type of bins. All currently using categorical x values.
As is the wont of our times I tried very hard to solve this with ChatGPT, to no avail, so I asked it write us a poem:
Oh Bokeh, why must thou be so tough?
With categorical data, we've had enough.
We long to see just every second tick,
But alas, it seems the answer's too quick.
We've tried and tried, but all in vain,
To show just some ticks and hide the rest again.
We've searched high and low, but to no avail,
It seems that this feature is simply unavailable.
We've used CustomJS, tried lists and such,
But still the solution is just out of touch.
It's like we're stuck in a never-ending fight,
With Bokeh, the plotting library of might.
But despite our frustration, we must say,
Bokeh's beauty and power cannot be swayed.
So we'll keep trying, keep pushing on,
Until we find a way to make it dawn.