Fix error due to DISPLAY variable and interactive Matplotlib backends