Tyler B wrote:
> Hi there,
>
> I am trying to run a python script on my computer at a regular
> interval [in the background] to output an image file using
> matplotlib.  My problem is that every time the script runs, it
> momentarily steals focus from whatever I'm working on -- which over
> time gets to be very annoying.
>
> I think that I've narrowed it down to a single line in the python script:
> fig = plt.figure(facecolor ='w', frameon=False)
>
> [note that I've imported matplotlib.pyplot as plt earlier]
>
> I made a short video to show the problem:
> http://screencast.com/t/MRObeKrx
>
> Can anyone think of a good way to prevent matplotlib from stealing
> focus??  This is the last problem I have to solve.. though I'm out of
> ideas.
You don't show the beginning of your script, but try:

import matplotlib
matplotlib.use('Agg')

before any other MPL imports.

------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to