generate graph as png, detect parse error