How to save graphviz_char into a picture file?

I’m using


to display the graph, and how to save the graph into one JPG picture file ?

Hi @diao, welcome to the Streamlit community!

Please note that st.graphviz_chart on the Streamlit side is display only, so it won’t have any methods for saving. However, whatever library that is creating graph should have a method for exporting the graph.


Hi @randyzwitch ,
Thanks for your quickly reply.
I’m using a Dot language for the st.graphviz_chart, like the demo

    digraph {
        run -> intr
        intr -> runbl
        runbl -> run
        run -> kernel
        kernel -> zombie
        kernel -> sleep
        kernel -> runmem
        sleep -> swap
        swap -> runswap
        runswap -> new
        runswap -> runmem
        new -> runmem
        sleep -> runmem

so , seems I should find another lib which transfer Dot language into picture.
Thanks .