4.0

4.0 | 1 rating Rate this file 47 downloads (last 30 days) File Size: 184.72 KB File ID: #24035

wgPlot - Weighted Graph Plot (a better version of gplot)

by Mike Wu

 

07 May 2009 (Updated 23 Jun 2009)

Code covered by BSD License  

Plot graphs with weighted vertices and weighted edges from a weighted adjacency matrix.

Download Now | Watch this File

File Information
Description

Plot graphs just like gplot. But allow user to input an adjacency matrix with weighted edges and/or weighted vertices. The Edge weights are mapped to a colormap. The vertex weights are proportional to the vertex size. Using parameter-value pairs, user can even specify the vertex scaling factor, edge width, and the colormap used to show other meta data associated with the vertices. (Couple of the graph included as example were from David Gleich's matlabBGL package.)

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
gplotwl, MatlabBGL

MATLAB release MATLAB 7.8 (R2009a)
Zip File Content  
Other Files license.txt,
wgPlot/axesArea.m,
wgPlot/cores_example.mat,
wgPlot/cs-stanford.mat,
wgPlot/prh.m,
wgPlot/README.txt,
wgPlot/wgPlot.jpg,
wgPlot/wgPlot.m,
wgPlot/wgPlotDemo.m
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
02 Aug 2009 Jeroen

Even for a very simple example, i get an error:

>> wgplot(sprand(10,10,0.2), rand(10,2));

> In wgPlot at 36
  In corrcoeff at 44
??? Error using ==> ishghandle
Too many input arguments.

Error in ==> axesArea at 25
if ishghandle(varargin{1},'axes')

Error in ==> wgPlot at 36
axesArea(h,[6 7 5 5]);

What's wrong?

03 Nov 2009 Reza Farrahi Moghaddam

Please apply the following changes:

1. file: wgPlotDemo.m, line: 2, load('cores_example.mat')
2. file: wgPlotDemo.m, line: 46, load('cs-stanford.mat')
3. file: axesArea.m, line: 25, if ishghandle(varargin{1})
4. file: wgPlot.m, line: 150, hV=scatter(coord(qq,1),coord(qq,2),vWt(qq),vrtxCol(qq),'filled');
5. file: wgPlot.m, line: 153, hV=scatter(coord(qq,1),coord(qq,2),vWt(qq),'filled','MarkerFaceColor',[1,0.5,0.2]);

Please login to add a comment or rating.
Updates
18 May 2009

Added an missing auxiliary file for setting the axes' plot area. And updated the wgPlot to include a parameter for changing the marker style.

18 May 2009

Added a missing helper file for setting the plot area for plotting the graph. Also updated wgPlot to include parameter-value pairs for specifying the marker style.

19 May 2009

Fixes a minor but that plots all the vertices even when some of them are not connected to any other vertices. Now it only plots vertices that have connections by default when the adjacency matrix has lot of row/columns with no connections.

05 Jun 2009

fix bug on plotting colored/sized markers over the default marker when user specify the vertex weight/meta data.

23 Jun 2009

included a missing helper function prh.m

Tag Activity for this File
Tag Applied By Date/Time
gplot Mike Wu 08 May 2009 10:17:13
weighted graph Mike Wu 08 May 2009 10:17:13
plot Mike Wu 08 May 2009 10:17:13
draw Mike Wu 08 May 2009 10:17:13
network Mike Wu 08 May 2009 10:17:13
graph Mike Wu 08 May 2009 10:17:13
visualization Mike Wu 08 May 2009 10:17:13
network HC Chinta 17 Oct 2009 16:34:51
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com