I am trying to create ipywidgets tab and I am looking for one particular numeric widget in a tab, currently, I am seeing both the tabs as common, how can I see size1 in tab[out2] specifically. My existing code looks like following
import ipywidgets as widgets
from ipywidgets import HBox, VBox, Button, Layout, Label
from ipywidgets import interact, interactive, fixed, interact_manual
size = widgets.IntSlider(value=50, min=0,max=100,step=1, description='size:')
size1 = widgets.IntSlider(value=20, min=0,max=50,step=1, description='size1:')
def hist1(size):
data = pd.DataFrame(np.random.normal(size = size))
data.plot.hist()
return
def hist2(size1):
data = pd.DataFrame(np.random.normal(size = size1))
data.plot.box()
return
ui = widgets.VBox([size,size1])
out1 = widgets.interactive_output(hist1, {'size':size})
out2 = widgets.interactive_output(hist2, {'size1':size1})
tab = widgets.Tab(children = [out1, out2])
tab.set_title(0, 'hist')
tab.set_title(1, 'box')
display(ui,tab)
it's giving me following
but I am seeking to see size1 slider in out2 i.e. box tab, how can I do this with existing code to have a specific slider for tabs