Michael Droettboom wrote: > John Hunter wrote: > >> In unrelated news, I am not in favor of the recent change to warn on >> non-GUI backends when "show" is called. I realize this may sometimes >> cause head-scratching behavior for some users who call show and no >> figure pops up, but I think this must be pretty rare. 99% of users >> have a matplotlibrc which defines a GUI default. AFAIK, the only >> exceptions to this are 1) when the user has changed the rc (power >> user, needs no protection) or 2) no GUI was available at build time >> and the image backend was the default backend chosen (warning more >> appropriate at build time). If I am missing a use case, let me know. >> >> > The motivation was when a popular Linux distribution misconfigured the > default to the Agg backend: > > https://bugs.launchpad.net/ubuntu/+source/matplotlib/+bug/278764 > > This warning was meant as future insurance against this happening -- and > hoping that if the packagers don't make a GUI backend the default (in an > attempt to reduce dependencies), that they at least would include the > warning patch so that users aren't left feeling that matplotlib is "broken". > > But we can't prevent all downstream packaging errors, so maybe this > patch doesn't belong in trunk. ;) > >> I like the design where the same script can be used to either generate >> a UI figure or hardcopy depending on an rc settng or a command flag >> (eg backend driver) and would rather not do the warning. This has >> been a very infrequent problem for users over the years (a few times >> at most?) so I am not sure that the annoyance of the warning is >> justified. >> >> > Perhaps the warning could only be emitted when running inside an > interactive console (ipython or standard python) -- if that's possible. > Alternatively, "ipython -pylab" could warn on startup if the backend is > non-GUI (and that change would probably live in ipython). I have modified the code to only do this when show() is called directly from the python or ipython console. Calling show() from a script will not emit this warning.
If that's still too noisy, I'm happy to revert the whole thing. Mike ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel