Code covered by the BSD License  

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
graphViz4Matlab

4.55556
4.6 | 10 ratings Rate this file 10 Downloads (last 30 days) File Size: 274 KB File ID: #21652 Version: 1.3
image thumbnail

graphViz4Matlab

by

Matt Dunham (view profile)

 

02 Oct 2008 (Updated )

Display a directed or undirected graph in a Matlab figure window.

| Watch this File

File Information
Description

This package, (formerly called Graphlayout) is now maintained here:
http://code.google.com/p/graphviz4matlab/

Please see this site the for the latest downloads and documentation.

Acknowledgements

This file inspired A Patch For Graph Viz4 Matlab Toolbox.

MATLAB release MATLAB 7.6 (R2008a)
Other requirements Requires Matlab 2008a or newer; GraphViz available free from http://www.graphviz.org/
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (12)
25 Mar 2016 Jack Ie  
25 Mar 2016 Jack Ie

display this error only:
'neato' is not recognized as an internal or external command,
operable program or batch file.

Comment only
04 Mar 2016 aaron callard

There is a bug, in that the node id's are assumed to be in linear order in the resulting dot file.
To fix this replace the following function in Graphvizlayout.m
function readLayout(obj)
% Parse the layout.dot file for the graphViz node locations and
% dimensions.
fid = fopen(obj.layoutFile,'r');
text = textscan(fid,'%s','delimiter','\n');
fclose(fid);
text = text{:};
[start,dims] = strtok(text{cellfun(@(x)~isempty(x),strfind(text,'graph [bb="'))},'"');
dims = textscan(strtok(dims,'"'),'%n','delimiter',',');
dims = dims{:}';
text(cellfun(@(x)~isempty(x),strfind(text,' -> ')))=[]; % delete edge info, we don't need it
node_id_text = text(cellfun(@(x)~isempty(x),strfind(text,'height'))); % keep only positions
node_id = str2double(strtok(node_id_text,' '));
text(cellfun(@(x)isempty(x),strfind(text,'pos')))=[]; % keep only positions
[start,remaining] = strtok(text,'"');
[locations,remaining] = strtok(remaining,'"');
locations = cellfun(@(str)textscan(str,'%n','delimiter',','),locations,'UniformOutput',false);
locations = [locations{:}];
locations = [locations{:}]';
% reorder based on id
locations(node_id,:) = locations;
obj.scaleLocations(locations,dims);
end

I do know if this fix works in all scenarios, but it appears to work for all of mine. Without the fix, the resulting images aren't very pretty.

04 Mar 2016 aaron callard  
23 Jan 2013 Reza Farrahi Moghaddam  
11 Jan 2013 Peter Merk

Great tool! Very easy to use and nice graphics. The only thing missing is the possibility to name the edges.

18 Sep 2012 Marcel Rüland

Brilliant tool. Easy to use, very nice GUI and good idea.
Well done.
Thanks.

22 Jan 2012 Lie Tome

Works wonderfully well.

20 Jun 2011 haya

haya (view profile)

Hello, I'm trying to use graphViz4Matlab
I read the comments in the code and saw I can give only my adj matrix as input. I entered a 99x99 matrix and got the follow error:??? Error: File: C:\MATLAB7\work\Wlan-matrix2\graphViz4Matlab.m Line: 86 Column: 26
The expression to the left of the equals sign is not a valid target for an assignment.
In the code the line itself is:
properties(GetAccess = 'public', SetAccess = 'private')
can you please tell me what i did wrong, I expected a simple line like this wont have any problem
thank you

Comment only
28 Jul 2010 Julian Xue

Works great, but takes forever for large graphs (>1000 nodes). Is there a faster version available?

17 Apr 2010 Shicai Yang

it looks great~

12 Oct 2009 Daniel Zoran  
Updates
04 Feb 2010 1.1

Various bug fixes, as well as an additional option to color the edges.

27 Feb 2010 1.2

Now automatically adds graphViz to your system path, from within Matlab, (if running windows).

03 Mar 2010 1.3

Fixed a small bug in the setupPath() function of the util directory. Output argument was not always getting set.

Contact us