Code covered by the BSD License  

Highlights from
Plot a Directed Graph (v2.0)

Be the first to rate this file! 28 Downloads (last 30 days) File Size: 2.43 KB File ID: #19580
image thumbnail

Plot a Directed Graph (v2.0)

by Joseph Kirk

 

14 Apr 2008 (Updated 15 Apr 2008)

plots a directed graph represented by an adjacency matrix and xy points

| Watch this File

File Information
Description

GPLOTDC Plot a Directed Graph
GPLOTDC(A,XY) Plots the Directed Graph represented by adjacency matrix A and points xy using the default style described below
GPLOTDC(A,XY,PARAM1,VAL1,PARAM2,VAL2,...) Plots the Directed Graph using valid parameter name/value pairs

Inputs:
A - NxN adjacency matrix, where A(I,J) is nonzero (=1) if and only if there is an edge between points I and J
xy - Nx2 matrix of x/y coordinates
... - Parameter name/value pairs that are consistent with valid PLOT parameters can also be specified
 
Default Plot Style Details:
1. Undirected (2-way) edges are plotted as straight solid lines (blue)
2. Directed (1-way) edges are plotted as curved dotted lines with the curvature bending counterclockwise moving away from a point (red)
3. Any vertex that is connected to itself is plotted with a circle around it (black)

Note: The directed edges are curved, thus providing an easy visualization of the edge direction. The curvature bends counterclockwise (or to the right of a straight line) for edges moving away from a point. For example, in the screenshot, there is an edge connecting point 6 to point 7, and one connecting point 8 to point 5, but not the other way around.

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
Plot a Directed Graph

MATLAB release MATLAB 7.6 (R2008a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
specialized Joseph Kirk 22 Oct 2008 09:57:55
plotting Joseph Kirk 22 Oct 2008 09:57:55
directed graph Joseph Kirk 22 Oct 2008 09:57:55
graph Joseph Kirk 22 Oct 2008 09:57:55
gplotd Joseph Kirk 22 Oct 2008 09:57:55
gplot Joseph Kirk 22 Oct 2008 09:57:55
plot Joseph Kirk 22 Oct 2008 09:57:55
directed graph Alan Bindemann 20 Jan 2009 07:37:56
graph Alan Bindemann 20 Jan 2009 07:38:00

Contact us at files@mathworks.com