Documentation

Graph::plotCircleGraph

Plots a Graph in a circle layout

Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.

Syntax

Graph::plotCircleGraph(G, <PointSize = n>, <SpecialVertices = [v1, …,vn]>, <SpecialEdges = [e1, …,en]>, <EdgeColor = RGB>, <SpecialEdgeColor = RGB>, <SpecialVertexColor = RGB>, <Vertex1Color = RGB>, <Vertex2Color = RGB>)

Description

Graph::plotCircleGraph(G) returns a plot::Group2d object in which the vertices are ordered in a circle (rightmost position upwards). The first vertex is drawn in blue and the second in green. All other vertices are drawn in red. The edges are drawn in red. The width of the points is predefined with 40. If a vertex points to itself it will be drawn outside

Examples

Example 1

A random graph is created and plotted (your output may differ due random creation):

G1 := Graph::createRandomGraph(20, 10, Undirected):
plot(Graph::plotCircleGraph(G1))

Next, a complete graph will be plotted.

G1 := Graph::createCompleteGraph(20):
plot(Graph::plotCircleGraph(G1))

Example 2

If some edges are to be emphasized they can be drawn in a special color:

G2 := Graph([1, 2, 3, 4, 5],
            [[1, 2], [2, 3], [3, 4], [4, 5],
             [1, 3], [1, 4], [1, 5]]):  
edges := [[1, 3], [1, 4]]:
plot(Graph::plotCircleGraph(G2, 
                SpecialEdges = edges, SpecialEdgeColor = RGB::Blue))

Parameters

G

Graph

n

a positive integer

[v1, …,vn]

a list of vertices

[e1, …,en]

a list of edges

Options

PointSize

Defines the thickness in which the points are drawn. Default is 40.

SpecialVertices

Defines a set of vertices. This option makes only sense if used with the option SpecialVertexColor.

SpecialEdges

Defines a set of edges. This option makes only sense if used with the option SpecialEdgeColor.

EdgeColor

Defines a color with which to draw the edges. Default is RGB::Red

SpecialEdgeColor

Defines a color to be used to draw the set of edges specified. This option makes only sense if used with the option SpecialEdges

VertexColor

Defines a color with which to draw the vertices. If this option is specified, the first two vertices are set to this color, too. They must be specified via Vertex1Color and Vertex2Color to distinct them again. Default is RGB::Red

SpecialVertexColor

Defines a color to be used to draw the set of vertices specified. This option makes only sense if used with the option SpecialVertices

Vertex1Color

Defines a color with which to draw the uppermost left (first) vertex with (the starting vertex). Default is RGB::Blue

Vertex2Color

Defines a color with which to draw the second vertex with. Default is RGB::Green

Return Values

plot::Group2d

Was this topic helpful?