Does anyone have a tutorial on using GraphViz on Windows?

I have used graphviz on Unix before.

I am trying to use it on Windows and I am having some issues.

I try a really simple dot file that has a lot of node connections, but nothing else.

I invoke dot.exe -Tpdf > may.pdf

A file is created, but Adobe Reader says it is damaged and won't read it.

Then I try dot.exe -Tsvg > may.svg

And I try to get IE to display the file but nothing ever displays.

I can't figure out if I am missing something or if it just does not work on Windows.

more info

dot.exe -V

dot - graphviz version 2.39.20150129.0545 (20150129.0545)


using -o may.pdf creates a PDF file. Acroread on my desktop opens that file. But there doesn't appear to be anything actually on the page - I have scrolled around and see nothing, and the svg was a hot mess as I expected my data to be :sigh:


So perhaps on windows server 2008 r2 the pdf output driver doesn't work as expected, or perhaps my data is too messy to represent in PDF.

using GraphViz on Windows

Please can you try dot -Tpdf -o file.pdf instead of  > file.pdf  ?

It's slightly possible that a Windows shell does something
like CRLF mapping.  Though it seems like grasping at straws.


He does  mention in a related

He does  mention in a related item that he is using Windows' powershell, which may have different syntax. Certainly > file.pdf works fine in the old dos shell.

An update to this puzzle

So, in doing some more research, I found a message that indicated that internet explorer may still not display svg. When I tried displaying it with Firefox, the file did display what I expected.


When I opened the PDF in Firefox, I didn't get an error about a damaged file - but I still didn't get any of the data (which is, granted, a very large graph).

I expect my issue is more with my data and the tools being used to display it than with graphviz itself.

I just thought that perhaps I was missing something obvious.

I am able to display my data with dotty and dvedit as well, so I think that, at least for right now, things will be okay. I have to regenerate my data anyways.


Thank you for confirming that I was in fact using the tools properly.

I've always been surprised that people had not writen more nice wrappers around graphviz on Windows.

I thought about asking about

I thought about asking about the graph's size. I vague recall something like this came up in the past, where there were problems on Windows displaying large graphs. In some cases, the graphs were there but scrolled off the window. The initial view is the upper-right corner, which is all blank space. As a sanity check, try adding -Gsize=8 or something to make sure the output is small enough to fit in on the screen.

You are doing everything

You are doing everything correctly and it should work. When I repeat your uses of dot, I get perfectly fine pdf and svg files.

There may be something wrong with your version of graphviz (What version are you using? Run dot -V) What version of Windows are you using? Can you provide and may.svg, either here or by filing a bug report?

Graphviz ruby on windows

I don't manage to work this file on ruby:

require 'graphviz'

# Create a new graph
g = :G, :type => :digraph )

# Create two nodes
hello = g.add_nodes( "Hello" )
world = g.add_nodes( "World" )

# Create an edge between the two nodes
g.add_edges( hello, world )

# Generate output image
g.output( :png => "hello_world.png" )

coz it gives me an error:

"C:\Ruby193\rubywork>ruby helloworld.rb
C:/Ruby193/lib/ruby/site_ruby/1.9.1/graphviz.rb:544:in `output':
GraphViz not in
stalled or dot not in PATH. Install GraphViz or use the 'path' option
from helloworld.rb:14:in `<main>'


I installed Graphviz program, but...I don't know why it doesn't work.

Can you help me?

Thank you so much,

Graphviz may not be in your

Graphviz may not be in your PATH as the error message says. Run

  dot -V

in your dos shell and see if dot is found. If not, you will have to use the registry to add the path to the Graphviz bin to your PATH variable.

dot -V is a linux

dot -V is a linux command?

I'm on dos shell of Windows :(

How can I add the path to the Graphviz bin to the PATH variable?


Thank you for helping me ;)

dot is a Graphviz command. If

dot is a Graphviz command. If you have installed Graphviz on Windows and its bin directory is in your PATH, you can open a dos shell and type in

  dot.exe -V

and it will print out the version information on Graphviz. If Graphviz has not been installed or its bin is not in your PATH, the dos shell will say that it is not recognized as a command.

If you used our .msi package for installation, Graphviz was installed by default in C:\Program Files\Graphviz2.38 so its bin directory is given by the path C:\Program Files\Graphviz2.38\bin. You want to add the last path to your system's PATH variable. How this is done depends on what version of Windows you use. See the instructions given in, for example, for your version of Windows. Or google the phrase change PATH variable in windows in a browser to find other instructions.

Wowwww, it worked :) I added

Wowwww, it worked :)

I added path C:\Program Files (x86)\Graphviz2.38\bin to the other path: C:\Ruby193\bin

Thank you...

Now...I've to write an algorithm to solve a Steiner problem :O

Do you know it?


Recent comments