WOLFRAM

generates a plot showing the community structure of the graph g.

CommunityGraphPlot[g,{{vi1,vi2,},}]

generates a plot for the graph g with communities {vi1,vi2,}, .

CommunityGraphPlot[g,{,wj[{vi1,}],}]

generates a plot with highlighting features defined by the symbol wrappers wj.

CommunityGraphPlot[{vi1vj1,vi2vj2,},]

generates a plot for a graph in which vertex vik is connected to vertex vjk.

generates a plot for a graph represented by the adjacency matrix m.

Details and Options

Examples

open allclose all

Basic Examples  (2)Summary of the most common use cases

Show communities in a graph:

Out[1]=1

Find communities:

Out[2]=2

Show the communities:

Out[3]=3

Scope  (8)Survey of the scope of standard use cases

CommunityGraphPlot works with undirected graphs:

Out[1]=1

Directed graphs:

Out[1]=1

Multigraphs:

Out[1]=1

Mixed graphs:

Out[1]=1

Specify a graph using a rule list:

Out[1]=1

Adjacency matrix:

Out[1]=1

Specify communities:

Out[1]=1

Wrappers:

Out[1]=1
Out[2]=2

Options  (17)Common values & functionality for each option

AspectRatio  (2)

By default, CommunityGraphPlot automatically determines the height to width ratio for the plot:

Out[3]=3

Make the height the same as the width with AspectRatio1:

Out[1]=1

CommunityBoundaryStyle  (4)

The default community boundary style is a gray line:

Out[1]=1

Use black boundary lines:

Out[1]=1

Use None to not show boundary lines:

Out[1]=1

Alternate between red and dashed boundary lines:

Out[1]=1

CommunityLabels  (3)

Generate labels for communities:

Out[1]=1

Use Labeled to specify individual labels:

Out[1]=1

Use Placed to control the placement of labels:

Out[1]=1

CommunityRegionStyle  (3)

The default community region style is None:

Out[1]=1

This can also be obtained with CommunityRegionStyle->None:

Out[2]=2

Use green colors on community regions:

Out[1]=1

Alternate between red and blue colors on community regions:

Out[1]=1

Method  (2)

By default, CommunityGraphPlot uses a force-directed layout:

Out[1]=1

This can also be obtained with Method->"SpringElectrical":

Out[2]=2

Use Method->"Hierarchical" for a hierarchical layout:

Out[1]=1

PlotLegends  (3)

Generate a legend for communities:

Out[1]=1

Use Legended to specify individual legend entries:

Out[1]=1

Use Placed to control the placement of legends:

Out[1]=1
Wolfram Research (2012), CommunityGraphPlot, Wolfram Language function, https://reference.wolfram.com/language/ref/CommunityGraphPlot.html.
Wolfram Research (2012), CommunityGraphPlot, Wolfram Language function, https://reference.wolfram.com/language/ref/CommunityGraphPlot.html.

Text

Wolfram Research (2012), CommunityGraphPlot, Wolfram Language function, https://reference.wolfram.com/language/ref/CommunityGraphPlot.html.

Wolfram Research (2012), CommunityGraphPlot, Wolfram Language function, https://reference.wolfram.com/language/ref/CommunityGraphPlot.html.

CMS

Wolfram Language. 2012. "CommunityGraphPlot." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/CommunityGraphPlot.html.

Wolfram Language. 2012. "CommunityGraphPlot." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/CommunityGraphPlot.html.

APA

Wolfram Language. (2012). CommunityGraphPlot. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CommunityGraphPlot.html

Wolfram Language. (2012). CommunityGraphPlot. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CommunityGraphPlot.html

BibTeX

@misc{reference.wolfram_2025_communitygraphplot, author="Wolfram Research", title="{CommunityGraphPlot}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/CommunityGraphPlot.html}", note=[Accessed: 06-June-2025 ]}

@misc{reference.wolfram_2025_communitygraphplot, author="Wolfram Research", title="{CommunityGraphPlot}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/CommunityGraphPlot.html}", note=[Accessed: 06-June-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_communitygraphplot, organization={Wolfram Research}, title={CommunityGraphPlot}, year={2012}, url={https://reference.wolfram.com/language/ref/CommunityGraphPlot.html}, note=[Accessed: 06-June-2025 ]}

@online{reference.wolfram_2025_communitygraphplot, organization={Wolfram Research}, title={CommunityGraphPlot}, year={2012}, url={https://reference.wolfram.com/language/ref/CommunityGraphPlot.html}, note=[Accessed: 06-June-2025 ]}