question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Plotting in infinite loop when making multiple selections (MultiSelect), plot not being removed when updated and axis distored

See original GitHub issue

1). The plot does not reset. The new selected plots over the previous plot.

2). When the user makes multiple selections (ctrl+shift) the plot axis gets distorted and it seems to be running in an infinite loop

from pandas import *

import numpy as np
import sys, os

from bokeh.plotting import figure
from bokeh.layouts import layout, widgetbox
from bokeh.models.widgets import MultiSelect
from bokeh.io import curdoc
from bokeh.plotting import reset_output
import math

axis_map = {
    "y1": "y3",
    "y2": "y2",
    "y3": "y1",
}

x1 = np.linspace(0,20,62)
y1 = [1.26 * math.cos(x) for x in np.linspace(-1,1,62) ]
y2 = [1.26 * math.cos(x) for x in np.linspace(-0.95,.95,62) ]
y3 = [1.26 * math.cos(x) for x in np.linspace(-.9,.90,62) ]

TOOLS = "pan,wheel_zoom,box_zoom,reset,save,hover"

vars = MultiSelect(title="At what void[s]", value=["y1"], options=sorted(axis_map.keys()))

master_data = { 'rate' : x1, 
                'y1'   : y1, 
                'y2'   : y2,
                'y3'   : y3             
               }
               
p = figure(plot_height=600, plot_width=700, title="", toolbar_location=None)
pline = figure(plot_height=600, plot_width=700, title="", tools=TOOLS)

def select_data():
         for vox in vars.value:
             pline.line(x=master_data['rate'], y= master_data[vox], line_width=2)
             pline.circle(x=master_data['rate'], y=master_data[vox], line_width=2)
         return 

controls = [  vars]

for control in controls:
    control.on_change('value', lambda attr, old, new: select_data())


sizing_mode = 'fixed'  

inputs = widgetbox(*controls)
l = layout([
    [inputs, pline],
])

select_data() 

curdoc().add_root(l)
curdoc().title = "Plot"

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
bryevdvcommented, Feb 1, 2017

@ghrays thanks for the compete code sample. A quick run of the code on master and I don’t see the “infinite loop” behavior, but I also don’t see the plots updating as one would expect either. I think this might be the same underlying issue of #4875 (in which case it will be marked a dupe) but more investigation is needed.

0reactions
bryevdvcommented, Oct 13, 2017

I believe this was fixed as part of the work for the other issue. There is no flickering and selecting in the multiselect causes new data to appear (de-selecting does not remove but I would not expect it to–the example code does not do anything that would remove anything). Please re open is a reproducible problem persists.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bokeh MultiSelect plotting in infinite loop, distorting plot
When the user makes multiple selections (ctrl+shift) the plot axis gets distorted and it seems to be running in an infinite loop.
Read more >
Multiple selection in Checkbox sapui5 Infinite Loop
I am working on Checkbox. My requirement is selecting one of the checkbox from UI table some other checkbox values in the table...
Read more >
Using MATLAB Graphics
Remove the plotting tools from a figure using the Hide Plot Tools icon . ... Expand the Variables panel and shift-click (for multiple...
Read more >
SIMetrix
In the system control panel, select Add/Remove Programs ... Graph axes are no longer labelled using the greek letter µ to represent 10-6...
Read more >
Weibull++ 2020 User's Guide - Choose a ReliaSoft Help File
For growth data analysis, the Multi-Phase plot displays actual test results (e.g. ... To make sure that your analysis information is not deleted...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found