Code covered by the BSD License  

Highlights from
MATLAB GraphViz Layout importer

5.0

5.0 | 1 rating Rate this file 22 Downloads (last 30 days) File Size: 14.62 KB File ID: #24652
image thumbnail

MATLAB GraphViz Layout importer

by Bjorn Wielens

 

07 Jul 2009 (Updated 15 Jul 2009)

GraphViz DOT file importer. Features include colours (HTML/X11/RGB/HSV), shapes, line styles etc.

| Watch this File

File Information
Description

This code takes a GraphViz ready DOT file, passes it to Graphviz (either using dot (fallback to mwdot if not present) or a custom layout engine you specify.) The output is then parsed and drawn in an axes specified by you, along with returning object handles and information about the graph as an adjacency matrix.

Please see the comments at the beginning of the file for more information on usage/limitations.

It has been quite extensively tested, and should work for just about any graph you can throw at it. Furthermore, custom node shapes and arrows can be easily added.

While it can work with the built-in (and unsupported) mwdot function, it is recommended you install the full GraphViz suite, available at http://graphviz.org/ , along with extensive documentation and samples.

Credit goes to Jonas Ballani for his Bezier function which is used to draw the splines.
http://matlabdb.mathematik.uni-stuttgart.de/download.jsp?MC_ID=7&SC_ID=8&MP_ID=480

Also, the inspiration came from Leon Peshkin's GraphViz interface, which (unfortunately) didn't quite cut it for our needs, and required me to write my own.

If you use this in your software, I would greatly appreciate a credit in your software's about page; I've put a fair amount of time in to this project, and wish to spread the word that others may benefit from it. Questions, comments, and suggestions for improvement are welcome.

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
MATLAB - GraphViz interface
This submission has inspired the following:
GraphViz-like tools for MATLAB

MATLAB release MATLAB 7.7 (R2008b)
Other requirements Latest release (V 2.22 as of this writing) of GraphViz from http://www.graphviz.org/ is recommended.
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
13 Jul 2009 Bjorn Wielens

I do realize it may be a bit slow- Stay tuned; I'm working on a highly-optimized version!

16 Jul 2009 Alex

I use this everyday in my Matlab scripts and I love it! It seems to work with everything I throw at it. Good job!

Please login to add a comment or rating.
Updates
09 Jul 2009

-Fixed bug when using mcircle node type.
-Added autoSize and drawMode arguments.

15 Jul 2009

-Major speed optimizations.
- Realtime mode removed.
- 2 modes of operation
- Resolution of spline option.
- No need for x11colours.mat
- Removed temp file use.

Tag Activity for this File
Tag Applied By Date/Time
plot Bjorn Wielens 07 Jul 2009 11:13:19
edge Bjorn Wielens 07 Jul 2009 11:13:19
data import Bjorn Wielens 07 Jul 2009 11:13:19
graphviz Bjorn Wielens 07 Jul 2009 11:13:19
node Bjorn Wielens 07 Jul 2009 11:13:19
layout Bjorn Wielens 07 Jul 2009 11:13:19
undirected Bjorn Wielens 07 Jul 2009 11:13:19
directed_graph Bjorn Wielens 07 Jul 2009 11:13:19
plotting Bjorn Wielens 07 Jul 2009 11:13:19
drawing Bjorn Wielens 07 Jul 2009 11:13:19

Contact us at files@mathworks.com