I\'m generating matplotlib figures in a script which I run alternatively with or without a graphical display. I\'d like the script to adjust automatically: with display, it
You can detect directly if you have a display with the OS module in python. in my case it's
>>> import os >>> os.environ["DISPLAY"] ':0.0'