|
From: Benjamin R. <ben...@ou...> - 2013-10-03 13:16:42
|
On Thu, Oct 3, 2013 at 6:35 AM, ajdcds <aj...@ho...> wrote:
> Sorry, of course it does not work, the import is incorrect!
>
> It should be
>
> import matplotlib as plt
> plt.rcParams['backend'] = 'TkAgg'
>
> or simply
> import matplotlib
> matplotlib.rcParams['backend'] = 'TkAgg'
>
>
Errr... no, don't do "import matplotlib as plt". That is just confusing.
To change backends, do the following:
import matplotlib
matplotlib.use("TkAgg")
Because backends are loaded upon import of matplotlib, changing the rcParam
after importing matplotlib is too late. You force a switch of the backend
via the "use()" function.
|