Skip to main content
`Ctrl`+`K`

# Gallery

General-purpose and introductory examples for NetworkX. The tutorial introduces conventions and basic graph manipulations.

## Basic

Properties

Properties

Read and write graphs.

Read and write graphs.

Simple graph

Simple graph

## Drawing

Custom Node Position

Custom Node Position

Chess Masters

Chess Masters

Cluster Layout

Cluster Layout

Custom node icons

Custom node icons

Degree Analysis

Degree Analysis

Directed Graph

Directed Graph

Edge Colormap

Edge Colormap

Ego Graph

Ego Graph

Eigenvalues

Eigenvalues

Four Grids

Four Grids

House With Colors

House With Colors

Knuth Miles

Knuth Miles

Labels And Colors

Labels And Colors

Plotting MultiDiGraph Edges and Labels

Plotting MultiDiGraph Edges and Labels

Multipartite Layout

Multipartite Layout

Node Colormap

Node Colormap

Rainbow Coloring

Rainbow Coloring

Random Geometric Graph

Random Geometric Graph

Sampson

Sampson

Self-loops

Self-loops

Simple Path

Simple Path

Spectral Embedding

Spectral Embedding

Traveling Salesman Problem

Traveling Salesman Problem

Unix Email

Unix Email

Weighted Graph

Weighted Graph

## 3D Drawing

Mayavi2

Mayavi2

Animations of 3D rotation and random walk

Animations of 3D rotation and random walk

Basic matplotlib

Basic matplotlib

## Graphviz Layout

Examples using Graphviz layouts with `nx_pylab` for drawing. These examples need Graphviz and PyGraphviz.

Atlas

Atlas

Circular Tree

Circular Tree

Decomposition

Decomposition

Giant Component

Giant Component

Lanl Routes

Lanl Routes

## Graphviz Drawing

Examples using Graphviz for layout and drawing via `nx_agraph`. These examples need Graphviz and PyGraphviz.

Attributes

Attributes

Conversion

Conversion

2D Grid

2D Grid

Atlas

Atlas

## Graph

DAG - Topological Layout

DAG - Topological Layout

Degree Sequence

Degree Sequence

Erdos Renyi

Erdos Renyi

Expected Degree Sequence

Expected Degree Sequence

Karate Club

Karate Club

Morse Trie

Morse Trie

Minimum Spanning Tree

Minimum Spanning Tree

Napoleon Russian Campaign

Napoleon Russian Campaign

Roget

Roget

Triads

Triads

Visibility Graph

Visibility Graph

Words/Ladder Graph

Words/Ladder Graph

## Algorithms

Beam Search

Beam Search

Betweenness Centrality

Betweenness Centrality

Blockmodel

Blockmodel

Circuits

Circuits

Cycle Detection

Cycle Detection

Davis Club

Davis Club

Dedensification

Dedensification

Community Detection using Girvan-Newman

Community Detection using Girvan-Newman

Greedy Coloring

Greedy Coloring

Image Segmentation via Spectral Graph Partitioning

Image Segmentation via Spectral Graph Partitioning

Iterated Dynamical Systems

Iterated Dynamical Systems

Krackhardt Centrality

Krackhardt Centrality

Lowest Common Ancestors

Lowest Common Ancestors

Maximum Independent Set

Maximum Independent Set

Parallel Betweenness

Parallel Betweenness

Reverse Cuthill–McKee

Reverse Cuthill--McKee

Find Shortest Path

Find Shortest Path

SNAP Graph Summary

SNAP Graph Summary

Subgraphs

Subgraphs

## External libraries

Examples of using NetworkX with external libraries.

JavaScript

JavaScript

igraph

igraph

## Geospatial

The following geospatial examples showcase different ways of performing network analyses using packages within the geospatial Python ecosystem. Example spatial files are stored directly in this directory. See the extended description for more details.

Graphs from Polygons

Graphs from Polygons

## Subclass

Antigraph

Antigraph

Print Graph

Print Graph

Gallery generated by Sphinx-Gallery