使matplotlib绘图窗口作为活动窗口弹出 [英] make matplotlib plotting window pop up as the active one

查看:763
本文介绍了使matplotlib绘图窗口作为活动窗口弹出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Mac OS X上使用python和matplotlib. 当我在许多不同的窗口上工作时,必须运行生成绘图的脚本,绘图窗口始终在活动窗口后面打开,并且非常沮丧,不得不在两个窗口之间切换以查看图像. 为什么要确定绘图窗口的位置和/或将其弹出为前景窗口?

I'm working with python and matplotlib on mac os x. When I'm working on many different windows and I have to run a script which produces a plot, the plot window always open behind the active window and is very frustration having to switch between windows for looking at the image. Is it any why to decide the location of the plot window, and/or pop up it as foreground window?

谢谢

推荐答案

我完全被同样的问题困扰.我终于找到了解决方案(在pylab模式下,带有qt4agg后端):

I was bothered by exactly the same problem. I found finally a solution (in pylab mode, with qt4agg backend):

get_current_fig_manager().window.raise_()

fig = gcf()
fig.canvas.manager.window.raise_()

关于, 马库斯

这篇关于使matplotlib绘图窗口作为活动窗口弹出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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