gDef.setImageFormat("png");
gDef.gprint("triples", ConsolFun.AVERAGE, "average triples/sec: %,.0f\\l");
RrdGraph graph = new RrdGraph(gDef);
BufferedImage img = new BufferedImage(900,750, BufferedImage.TYPE_INT_RGB);
graph.render(img.getGraphics());
try (OutputStream stream = Files.newOutputStream(gFile, StandardOpenOption.TRUNCATE_EXISTING)) {
ImageIO.write(img, "png", stream);
}