如何在 Pycharm 中查看绘图? [英] How to see plotly graphs in Pycharm?

查看:223
本文介绍了如何在 Pycharm 中查看绘图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到以下渲染器可用:

默认渲染器:'browser'可用的渲染器:['plotly_mimetype', 'jupyterlab', 'interact', 'vscode','notebook'、'notebook_connected'、'kaggle'、'azure'、'colab'、'json'、'png'、'jpeg'、'jpg'、'svg'、'pdf'、'浏览器'、火狐"、铬"、铬"、iframe"、iframe_connected"、'狮身人面像画廊']

但我不知道如何让 Pycharm 在 IDE 中显示输出,就像我使用 Matplotlib 绘制图表时一样.

如何做到这一点?


这是我使用的代码,来自 plotly 的示例:

fig = go.Figure(数据=[go.Bar(y=[2, 1, 3])],layout_title_text=测试";)图.show()

这将打开一个浏览器选项卡以在 Pycharm 调试器中运行时显示图形.


我从一年前看到一个类似的问题,但没有解决方案:

Pycharm

I see the following renderers are available:

Default renderer: 'browser'
    Available renderers:
        ['plotly_mimetype', 'jupyterlab', 'nteract', 'vscode',
         'notebook', 'notebook_connected', 'kaggle', 'azure', 'colab',
         'json', 'png', 'jpeg', 'jpg', 'svg', 'pdf', 'browser',
         'firefox', 'chrome', 'chromium', 'iframe', 'iframe_connected',
         'sphinx_gallery']

but I don't see how I can get Pycharm to show the output, in the IDE, like when I do graphs with Matplotlib.

how can this be done?


Edit:

This is the code I use, sample from plotly:

fig = go.Figure(
    data=[go.Bar(y=[2, 1, 3])],
    layout_title_text="test"
)
fig.show()

This will open a browser tab to show the graph while run in the Pycharm debugger.


Edit2:

I see a similar question, from a year ago, with no solution:

Plotly chart is not displayed in PyCharm

解决方案

Follow the below steps:

  • right click and select "Run file in python console"
  • after that browser will be opened with graph output

See screenshot below:

Pycharm

这篇关于如何在 Pycharm 中查看绘图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆