I think option 3 is what you want. Before import fipy or anything else, start your script with ``` import matplotlib matplotlib.use('backend') ```
> On Mar 13, 2019, at 9:43 AM, Christoph Margenfeld > <c.margenf...@tu-braunschweig.de> wrote: > > Hello, > > as mentioned in the FiPy FAQ, a different Matplotlib backend has to be > used when exporting images from the MatplotlibViewer class without any > output to the screen. > > From the Matplotlib documentation (at > https://gcc01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmatplotlib.org%2Ftutorials%2Fintroductory%2Fusage.html%23what-is-a-backend&data=02%7C01%7Cjonathan.guyer%40nist.gov%7Cfcdca20d85b343ceac4b08d6a7ba19f0%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C636880815078320111&sdata=%2B0YF4KH4MUJJcHVjxm5RXUpE%2BYUdSoLLcWEn6HAlmsE%3D&reserved=0), > > there are three ways to select a backend. The first two would involve > setting it in a .matplotlibrc file or as an environment variable. > However, that would affect all scripts run in that particular > environment, which I do not want to do. The third approach is setting > matplotlib.use('backend'). > > How can I select a Matplotlib backend for a certain MatplotlibViewer > without affecting any other scripts run from my environment? > > Thank you! > > Best regards, > Christoph Margenfeld > _______________________________________________ > fipy mailing list > fipy@nist.gov > http://www.ctcms.nist.gov/fipy > [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ] _______________________________________________ fipy mailing list fipy@nist.gov http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]