CLI support systems with no display
matplotlib.pyplot throws a RuntimeError when no display is present. One way around that is to set the backend to AGG. But we don't want AGG when we do have a display. So we only want to set it opportunistically. But it also has to be set before anything else is imported. Kind of convoluted. So we really just import pyplot as opportunistically as possible, and then rely on setting AGG backend when we're sure we don't need it in main().
Showing with 13 additions and 4 deletions