View License

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

» Watch video

Highlights from
Plot a Directed Graph (v2.0)

5.0 | 1 rating Rate this file 11 Downloads (last 30 days) File Size: 2.43 KB File ID: #19580 Version: 1.0
image thumbnail

Plot a Directed Graph (v2.0)


Joseph Kirk (view profile)


14 Apr 2008 (Updated )

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

| Watch this File

File Information

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

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.


Plot A Directed Graph inspired this file.

This file inspired Exact Controllability Of Complex Networks.

MATLAB release MATLAB 7.6 (R2008a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (2)
22 Jan 2015 Aidos Sarsembayev

excuse me, could you tell me how to execute this code and where to insert the inputs? thank you!

Comment only
07 Feb 2013 Vladimir

The idea with indicating edge directions by right-hand-curved lines is outstanding!

Contact us