Seaborn color brewer 不是交互式的

Seaborn color brewer not interactive

我正在尝试在 Jupyter 中使用 Seaborn 的交互式 color brewer 工具,但是我正在努力弄清楚如何以交互方式使用它。目前,它只是为我提供默认值。

Seaborn 的交互式 choose_colorbrewer_palette 工具需要 ipywidgets(或 IPython.html.widgets)。为了能够在 jupyter 中使用这些小部件,您需要激活它们

jupyter nbextension enable --py widgetsnbextension

要在 jupyter lab 中使用,您还需要安装 JupyterLab Extension

jupyter labextension install @jupyter-widgets/jupyterlab-manager

这需要安装 nodejs

所以在 conda 中的完整安装可能看起来像

> conda install seaborn juypter jupyterlab ipywidgets nodejs
> jupyter nbextension enable --py widgetsnbextension
> jupyter labextension install @jupyter-widgets/jupyterlab-manager

起始的 jupyter 实验室

> juypter lab

并按预期输入问题中的代码。