produce graph automatically on finish