Code covered by the BSD License  

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

4.6

4.6 | 5 ratings Rate this file 67 Downloads (last 30 days) File Size: 185 KB File ID: #24035
image thumbnail

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

by

 

07 May 2009 (Updated )

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

| 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

Gplotwl and Matlab Bgl inspired this file.

MATLAB release MATLAB 7.8 (R2009a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (8)
11 Dec 2013 Smita

Even after I fixed all the other bugs in wgPlotDemo, the last of the demos uses fruchterman_reingold_force_directed_layout, which was not included in wgPlotDemo. I downloaded that off of the mathBgl package, but that function refers to another function called fruchterman_reingold_mex which was not in that package! So now I'm not sure what to do. Any hints on where to find that function?

28 Oct 2013 Kishan

I cannot run the simple example, I get the following error:

figure;
tic;
[he,hv]=wgPlot(A,xy,'vertexWeight',rand(length(A),1));
toc
Error using scatter (line 68)
S must be a scalar or a vector the same length as X.

Error in wgPlot (line 153)
hV=scatter(coord(qq,1),coord(qq,2),vWt,'filled','MarkerFaceColor',[1,0.5,0.2]);

31 Mar 2013 Charles Nelatury

Thanks!

11 Mar 2013 AlexV Mantzaris

I commented out axesArea to get the network plot into a figure with other subplots and it works exactly as I need it. Work well and fast even for a large number of edges.

27 Mar 2012 Anthony Saccullo

Great program. Contains exactly what I'm looking for. I'm just having issues with the vertices having color. I'd like to have them all be a uniform size, but have the color change with weight. Or have both the color and size change would work too. The issue I'm having is that when the weight values are inputted some of the nodes do not show a weight. Any suggestions?

13 Dec 2010 Maxime

Very useful, nice display, computationally fast. Good job, thank you!

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]);

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?

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

Contact us