[bokeh] Howto delete a line from figure?

There are a could of possible ways, depending on your actual use case. I'm assuming you are asking how to do this from a JS callback:

* set the line color to null (or set the line alpha to 0)
* set the data source columns to be empty lists, e.g. .data['x'] =

This first just makes the line invisible, the second actually sets the line to have no data to plot.

It's probably also possible to literally remove the line renderer, but it's also probably not simple to do, either. The visible result should be indistinguishable from either of the above options, though, so hopefully one of them will work for you.



On Apr 16, 2016, at 6:25 PM, Ivo <[email protected]> wrote:

I like bokeh a lot but it gives me a hard time. How can I delete a line from a figure?

TOOLS = [BoxSelectTool(), HoverTool()]
fig=Figure(plot_width=800, plot_height=100,tools=TOOLS[i])
fig.line(x=xrange(200),y=xrange(200), color="navy", alpha=0.5, reset=True)

At some point I would like to delete the line, but how?

Could not find a single hint on the net.

Appreciate any hint a lot (final hurdle for my first bokeh project, puh).


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/e56a7a35-f1b7-4afc-93e4-8c73768858e0%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.