简体   繁体   English

使用 PyCharm 我想显示额外的图形窗口

[英]Using PyCharm I want to show plot extra figure windows

After installing Anaconda3 & PyCharm in new PC, I tried to test the same code as uploaded here在新 PC 中安装 Anaconda3 和 PyCharm 后,我尝试测试与此处上传的相同代码

And I got a window like this.我有一个这样的窗口。

在此处输入图片说明

But usually I use the plot window like this format (from google image search)但通常我使用这种格式的绘图窗口(来自谷歌图片搜索) 在此处输入图片说明

I think the first view is useful for checking all of the plots, but I'm already used to the second version, separated plot figure from PyCharm console, and I can use the control panel.我认为第一个视图对于检查所有绘图很有用,但是我已经习惯了第二个版本,将绘图从 PyCharm 控制台中分离出来,并且我可以使用控制面板。

So I want to use PyCharm as in the second picture.所以我想像第二张图一样使用 PyCharm。 How can I change my PyCharm settings to use the second version plot figure (extra window)?如何更改我的 PyCharm 设置以使用第二个版本的绘图图(额外窗口)?

That's because PyCharm is opening it in Sciview.那是因为 PyCharm 在 Sciview 中打开它。 Go to Settings => search for Python Scientific.转到设置 => 搜索 Python Scientific。 Uncheck the (only) box Show plots in toolwindows.取消选中(仅)框在工具窗口中显示图。 Restart Pycharm.重启 Pycharm。 It should work like a charm ;)它应该像魅力一样工作;)

Related to my answer here.与我在这里的回答有关

According to this , you can manually change the backend to fix the issue:根据,您可以手动更改后台来解决该问题:

matplotlib.use('Qt5Agg')

Thank you, @ImportanceOfBeingErnest , for digging up the thread.谢谢@ImportanceOfBeingErnest挖掘线程。

You need first to check if you have Pycharm Community or Pycharm Professional.您首先需要检查您是否拥有 Pycharm Community 或 Pycharm Professional。 You can plot in different windows just in case you have a professional version.您可以在不同的窗口中绘图,以防万一您拥有专业版本。 You can use seeting -> scientific python ( link : https://www.jetbrains.com/help/pycharm/matplotlib-support.html ).您可以使用设置 -> 科学 python(链接: https ://www.jetbrains.com/help/pycharm/matplotlib-support.html)。 Or, use matplotlib backends: Qt5Agg, Qt4Agg and TkAgg.或者,使用 matplotlib 后端:Qt5Agg、Qt4Agg 和 TkAgg。 ( https://intellij-support.jetbrains.com/hc/en-us/community/posts/360004382380-Matplotlib-doesn-t-show-plots-in-new-window ) https://intellij-support.jetbrains.com/hc/en-us/community/posts/360004382380-Matplotlib-doesn-t-show-plots-in-new-window

However, I can suggest you to download your plot in a file and close the window.但是,我建议您将绘图下载到文件中并关闭窗口。 So, you can have your plots in different windows.因此,您可以在不同的窗口中绘制图。 Check out this code:看看这个代码:

file = '___your path___'
... make your code for visualisation 
plt.show()
plt.savefig(file+'\\fig.png')
plt.close('all')

I was having the same problem, and not resolving it by only switching off scientific mode.我遇到了同样的问题,仅通过关闭科学模式无法解决它。 Just press command + shift + A or control + shift+ A and search python scientific, then clic on it and deselect show plots in tool window, you should be all set now.只需按 command + shift + A 或 control + shift+ A 并搜索python science,然后单击它并取消选择工具窗口中的显示图,您现在应该都设置好了。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Pycharm 不显示情节 - Pycharm does not show plot matplotlib在Windows上使用PyCharm不会绘制图形,没有错误 - matplotlib using PyCharm on Windows won't plot graphs, no error 无法使用matplotlib.pyplot在Pycharm中绘图..图形显示并立即消失 - Cannot plot in Pycharm using matplotlib.pyplot.. The figure showed up and disappeared instantly 我想使用 matplotlib 显示由 tensorflow 2.0 转换的灰度图 - I want to use matplotlib show a grayscale figure transformed by tensorflow 2.0 “用户警告:Matplotlib 当前正在使用非 GUI 后端的 agg,因此无法显示图形。” 在 Pycharm 上用 pyplot 绘制图形时 - "UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure." when plotting figure with pyplot on Pycharm 使用pycharm打开的Python无法满足我的要求 - Python with open using pycharm doesn't do what i want 如何使用 Python 绘制能源排名图? - How do I plot an energy ranking figure using Python? PyCharm Matplotlib "UserWarning: Matplotlib 当前正在使用 agg,这是一个非 GUI 后端,所以无法显示图。plt.show()" - PyCharm Matplotlib "UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure. plt.show()" RE: UserWarning: Matplotlib 目前正在使用 agg,它是一个非 GUI 后端,所以无法在 PyCharm 中显示 figure.plt.show() - RE: UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.plt.show() in PyCharm 在我的 Pycharm 中,为什么 df.plot() 没有出现在 PyCharm 中? - In my Pycharm why the df.plot() do not show up in PyCharm?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM