Generating png using Graphviz 2.38.0 on Anaconda Python 2.7

When I do this:

G.draw ('file.png')

I have the following error:

Format: "png" is not recognized. Use one of: cmapx cmapx_np dot eps fig gv imap imap_np ismap pic plain plain-ext pov ps ps2 svg svgz tk vml vmlz xdot xdot1.2 xdot1.4

I tried to run

dot -c

      

It does not change anything.

To install (or reinstall) Graphviz I used:

conda install -c https://conda.binstar.org/mutirri graphviz

Point output -v

render      :  dot fig map pic pov ps svg tk vml xdot
layout      :  circo dot fdp neato nop nop1 nop2 osage patchwork sfdp twopi
textlayout  :
device      :  canon cmap cmapx cmapx_np dot eps fig gv imap imap_np ismap pic plain plain-ext pov ps ps2 svg svgz tk vml vmlz xdot xdot1.2 xdot1.4
loadimage   :  (lib) eps gif jpe jpeg jpg png ps svg

      

An example that doesn't work:

import pygraphviz as pgv
G=pgv.AGraph(strict=False,directed=False)
G.add_edge('A','B')
G.layout(prog='neato')
G.draw('graph.png')

      

If I replace png with svg this example works.

+3


source to share





All Articles