Given a graph defined in SageMath:
G = Graph({...})
one can call G.show() to open a preview.
But how can I save this picture to file instead?
I'm aware I can do this within the preview dialog, but I can't see an option to do this from code.
Something like .write('/tmp/file').
I can use latex, write the output to a file, and then compile it with LaTeX, but this seems a little round the corner: