adding new lines with legend= breaks figure

I recently updated from bokeh 0.12.10 to bokeh 1.1.0, adding lines to a plot like below now produces shrinked plots in the canvas

from bokeh.plotting import figure
from bokeh.io import curdoc
from bokeh.layouts import gridplot
from bokeh.models import Button
import numpy as np

main fiure where lines will be plotted

fig = figure()

x = range(10)

def add_line():
new_line = fig.line(x,np.random.random(10)*100,legend=‘line{}’.format(len(fig.renderers)))

button = Button(label=‘test’)
button.on_click(add_line)

grid = gridplot([[button],[fig]],toolbar_location=None)

curdoc().add_root(grid)

``

Here is a screenshot of the output:

boktest.PNG

Is this a bug? Is there a new way to add new lines with legend in latest versions?

1 Like

Definitely a bug.

Thanks,

Bryan

···

On May 20, 2019, at 6:07 PM, Sébastien Roche <[email protected]> wrote:

I recently updated from bokeh 0.12.10 to bokeh 1.1.0, adding lines to a plot like below now produces shrinked plots in the canvas

from bokeh.plotting import figure
from bokeh.io import curdoc
from bokeh.layouts import gridplot
from bokeh.models import Button
import numpy as np

# main fiure where lines will be plotted
fig = figure()

x = range(10)

def add_line():
new_line = fig.line(x,np.random.random(10)*100,legend='line{}'.format(len(fig.renderers)))

button = Button(label='test')
button.on_click(add_line)

grid = gridplot([[button],[fig]],toolbar_location=None)

curdoc().add_root(grid)

Here is a screenshot of the output:
<boktest.PNG>

Is this a bug? Is there a new way to add new lines with legend in latest versions?

--
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/04ecdc27-e9f8-4acc-a20e-7a60468a45aa%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.
<boktest.PNG>