To run matplotlib there are a few setup parameters that are needed.
1.) Make sure that xorg-x11-server-Xvfb is installed on all compute nodes being used.
2.) Make sure that a display is initiated with this command:
3.) In your script, two environment variables need to be setup.