mardi 27 octobre 2015

ipywidgets: how to update plot with multiple series based on checkbox selection

I am using the Ipython notebook, pandas library, and the bokeh plotting library and I have a function that generates a gridplot. I am trying to set up some checkboxes, with each checkbox corresponding to one of those plots and then update the gridplot with only the plots that have their corresponding checkboxes selected. There does not seem to be much support for the ipywidgets libray. This is my attempt so far; I am not sure how to pass the checkboxes I created to my function to update my gridplot though, so any help will be much appreciated. Thanks.

attributes = df.columns.tolist()
from ipywidgets import Checkbox, interact
from IPython.display import display

chk = [Checkbox(description=attributes[i]) for i in range(len(attributes))]
#this displays the checkboxes I created correctly
display(*chk)

#update plot takes in the names of the columns to be displayed and returns 
#a gridplot containing all corresponding plots
#not sure about the part below though
interact(updatePlot,sensors=chk)




Aucun commentaire:

Enregistrer un commentaire