Allow graph.py to be ran on a headless system

Signed-off-by: Toon Schoenmakers <nighteyes1993@gmail.com>