☰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

FuncTickFormatter.from_py_func() example ValueError, Alternative?

Community Support
Satish_Kumar
Satish_Kumar

"I understand how you specify specific ticks to show in Bokeh, but my question is if there is a way to assign a specific label to show versus the position. So for example

plot.xaxis[0].ticker=FixedTicker(ticks=[0,1])

``

will only show the x-axis labels at 0 and 1, but what if instead of showing 0 and 1 I wanted to show Apple and Orange. Something like

plot.xaxis[0].ticker=FixedTicker(ticks=[0,1], labels=[‘Apple’, ‘Orange’])

``

"

Apparently, FuncTickFormatter.from_py_func() raises ValueError: Function ‘func’ may only contain keyword arguments in bokeh version 0.12.3.

Is there any alternative way to achieve this?

⌁   Link to post
Bryan
Bryan

Hi,

Can you provide the code you tried to use with FuncTickFormatter.from_py_func? Its hard to say much if speculation is needed, and providing real code is the quickest, fastest way to avoid needing to speculate.

There was also a recent PR concerning this feature:

  Fix FuncTickFormatter.from_py_func missing return value and update examples by canavandl · Pull Request #5409 · bokeh/bokeh · GitHub

So it may be that you will need to try a dev build or wait for the next release (although, again, I can't say for sure if this PR has anything to do with your situation without seeing the code you tried with FuncTickFormatter.from_py_func)

Thanks,

Bryan

···

On Oct 27, 2016, at 1:57 PM, Satish Kumar <p.kumarsatish@gmail.com> wrote:

"I understand how you specify specific ticks to show in Bokeh, but my question is if there is a way to assign a specific label to show versus the position. So for example
plot.xaxis[0].ticker=FixedTicker(ticks=[0,1])
will only show the x-axis labels at 0 and 1, but what if instead of showing 0 and 1 I wanted to show Apple and Orange. Something like
plot.xaxis[0].ticker=FixedTicker(ticks=[0,1], labels=['Apple', 'Orange'])
"
Apparently, FuncTickFormatter.from_py_func() raises ValueError: Function 'func' may only contain keyword arguments in bokeh version 0.12.3.

Is there any alternative way to achieve this?

--
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/abb8f01e-9fa1-4fee-91fd-1a58fa252d5d%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