使用“ipywidgets.iteract”,是否可以将输出定位在小部件旁边而不是小部件下方?
Using `ipywidgets.iteract`, is it possible to locate the output beside the widgets and not below them?
在 Jupyter notebooks 中使用 ipywidgets.interact
函数时,输出始终位于小部件下方。是否可以在小部件之外显示它?
换句话说,而不是这个:
(取自this example),
我希望看到这样的内容:
您可以使用 interactive
函数以及 HBox
和/或 VBox
以 this answer 为例,使用以下几行以获得所需效果:
hb = widgets.VBox([my_plts.children[0],my_plts.children[1]])
widgets.HBox([my_plts.children[2], hb])
然而,该图一开始并没有出现,您必须开始移动滑块才能渲染它。至少那是我的经验。我确定有办法解决它,但我懒得去调查。希望对您有所帮助!
在 Jupyter notebooks 中使用 ipywidgets.interact
函数时,输出始终位于小部件下方。是否可以在小部件之外显示它?
换句话说,而不是这个:
(取自this example),
我希望看到这样的内容:
您可以使用 interactive
函数以及 HBox
和/或 VBox
以 this answer 为例,使用以下几行以获得所需效果:
hb = widgets.VBox([my_plts.children[0],my_plts.children[1]])
widgets.HBox([my_plts.children[2], hb])
然而,该图一开始并没有出现,您必须开始移动滑块才能渲染它。至少那是我的经验。我确定有办法解决它,但我懒得去调查。希望对您有所帮助!