Embed Plotly HTML in PyCharm IDE

百般思念 提交于 2019-12-10 15:27:18

问题


I would like to see Plotly's HTML output in the PyCharm IDE. It currently says:

Process finished with exit code 0

for the output. However, I receive a graphical result in Jupyter


回答1:


To see the Plotly html output use the offline feature. For example, like this:

plotly.offline.plot(*yourplotname*, filename='file.html')

Run the code in pycharm and it will save the .html file locally in your work folder and open the .html in your browser to view.




回答2:


Dnaiel, as far as I understand plotly, it always creates an HTML file somewhere. Even in jupyter notebooks, I assume plotly creates a temporary HTML file although it draws the graph in the same window.

However, you can still use plotly in pycharm without having to specify the name of the new file. In that case, plotly simply overwrites the previous temporary HTML file in your working directory.

plotly.offline.plot(df2.iplot(kind='TypeOfChart',x='X_Var',y='Y_Var', asFigure=True))  


来源:https://stackoverflow.com/questions/39448549/embed-plotly-html-in-pycharm-ide

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!