MATLAB - GraphViz interface

Interface GraphViz graph layout and MATLAB user interface power.
Updated 6 Dec 2004

View License

Feb 2004 Massachusetts Institute of Technology, AI Lab
MATLAB <-> GraphViz by Dr. Leon Peshkin: pesha @ |

this is a README file for `ad hoc' MATLAB package created to interface AT&T GraphViz graph layout and MathWorks MATLAB user Interface powers. Please make sure you have both MATLAB and GraphViz properly installed on your system. The package works on Unix and even on Windows. Use at your own risk.

README - this file
graph_to_dot.m - Creates a GraphViz formated file from a graph given by an adjacency matrix.
dot_to_graph.m - Extracts an adjacency matrix, node labels, and layout from a GraphViz file.
graph_draw.m - Draws a graph in MATLAB with a given layout
make_layout.m - used to do a lame layout in case no layout is fed to graph_draw
draw_dot.m - a sample code illustrating use of package functions.
draws a graph defined by adjacency matrix, by
-first converting it to a GraphViz file (graph_to_dot)
-then calling NEATO of GraphViz to do a layout
-then importing layout file back into Matlab (dot_to_graph)
-finally calling graph_draw to display the layout
sample_click.m - an auxiliary sample code which allows to right-mouse-click on the nodes of
a graph to call a dummy function currently just printing that node's label
my_setdiff.m - my version of setdiff() which works much faster

Cite As

Leon Peshkin (2024). MATLAB - GraphViz interface (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R12.1
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on Directed Graphs in Help Center and MATLAB Answers

Inspired: MATLAB GraphViz Layout importer

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes

arc lables; other minor changes
like isolated nodes.