写在前面
使用Python做数据分析,最常用的IDE应该是Jupyter和Pycharm。
使用Python做报表展示,最常用的是Maplotlib,很方便,也很强大。但是如果要做的好看,那么用Plotly来代替Maplotlib应该是一个省时高效的方式。
本篇文章主要说明如何在Jupyter中使用Plotly(4.5.0)。
STEP 1.NodeJS
准备Jupyter插件编译环境,在Conda环境中安装NodeJS
conda install nodejs
STEP 2.安装Plotly
pip install plotly>=4.5.0
STEP 3.安装Jupyter插件,支持Plotly
安装Jupyter的widgets支持
jupyter labextension install @jupyter-widgets/jupyterlab-manager
安装Jupyter的plotlywidget插件
jupyter labextension install plotlywidget
安装Jupyter的plotly离线绘图支持插件
jupyter labextension install @jupyterlab/plotly-extension
结束
环境安装到此就结束了,可以自己去Jupyter中实验一把。