-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
saving to disk as SVG #91
Comments
Sorry for the late reply, |
@matthijsvk You can save the graph as SVG (or any other format supported by graph = draw_graph(model, ...).visual_graph
graph_svg = graph.pipe(format='svg').decode('utf-8') # convert to binary data
with open(save_path + '.' + format, 'wb') as f:
f.write(graph_svg) |
How can I save as png? |
s, u can @naik-amey. just set format arg to "png" |
Is your feature request related to a problem? Please describe.
If saving to disk, the default output format is PNG which is inefficient and low-resolution.
I couldn't find a way to save as SVG instead, though I'm sure graphviz supports this.
Describe the solution you'd like
add option "format=[svg|png]" that allows choosing the file format.
Alternatively, derive it from the filename, i.e. filename="model.svg" sets format=svg automatically.
Describe alternatives you've considered
This works:
but this first saves a PNG and then the SVG as well, it would be cleaner if we had an option in the draw_graph() function itself
The text was updated successfully, but these errors were encountered: