Lots of bokeh examples use the hold
command. I can see from the documentation that it's been deprecated since version 0.8.0
So I tried this:
x = figure(x_axis_type = "datetime", tools=Tools)
x.hold()
but no joy...attribute 'hold' does not exist
How do I update such examples to work on recent versions of bokeh?
As pointed out below, the answer to this question: bokeh overlay multiple plot objects in a GridPlot says that hold
is deprecated.
I think (from 3 seconds of experimentation), that hold
commands can just be removed. Since I don't know what it was meant to do, I can't verify this is correct :-).
I would be good to have that confirmed here.
Edit: just to clarify, this question and answer refer to the old hold()
plotting function, removed several years ago, and not to the more recent (and completely unrelated) Document.hold()
method for pausing server updates)
The bokeh.plotting
API used to have a notion of an implicit "current plot". By default, every plotting function like circle
or rect
created a new plot. The hold
function was intended to stop new plot creation, so multiple renderers could be added to the same plot. This was removed in favor of a more explicit interface that did not have a "current plot" notion. This provides more reliable interactions in the IPython notebook as well as server examples. To add multiple renderers on a single plot, it now looks like, for example:
p = figure(...)
p.circle(...)
p.rect(...)
Since all operations are now methods on explicit "plot" objects, there is no need for hold
(so there is no replacement for it).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With