FuncTickFormatter.from_py_func() example ValueError, Alternative?

"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?

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:

  https://github.com/bokeh/bokeh/pull/5409

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 <[email protected]> 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 [email protected].
To post to this group, send email to [email protected].
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.