SPF-OST / pytrnsys

Package that provides functionality to run and process, plot and report TRNSYS simulations
https://pytrnsys.readthedocs.io
GNU General Public License v3.0
11 stars 8 forks source link

Consider using a non-interactive `matplotlib` backend #119

Open zuckerruebe opened 2 years ago

zuckerruebe commented 2 years ago

A user ran into troubles during a post-processing run. She got the following quite unhelpful error message:

Fail to create pixmap with Tk_GetPixmap in TkImgPhotoInstanceSetSize

It was suggested elsewhere that using a different backend could fix the problem: https://github.com/matplotlib/matplotlib/issues/21950#issuecomment-993643121

It was further said in that issue that switching to an non-interactive backend could speed things up. Since we're not really using any interactive plotting functionality in pytrnsys (i.e. we're only generating static result plots) we might want to use a non-interactive backend to make things faster.

One way to change the backend to the non-interactive Agg, e.g., is

import matplotlib

matplitlib.use("Agg")

This is what the user did successfully.