Skip to main content
  • Install
  • Tutorial
  • Backends
  • Reference
  • Gallery
  • Developer
  • Releases
  • Guides
  • Home Page
  • GitHub
  • Install
  • Tutorial
  • Backends
  • Reference
  • Gallery
  • Developer
  • Releases
  • Guides
  • Home Page
  • GitHub
  • Gallery

Gallery#

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

Basic#

Image for: Basic#

Properties

Properties

Read and write graphs.

Read and write graphs.

Simple graph

Simple graph

Drawing#

Image for: 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

Spring Layout

Spring Layout

Traveling Salesman Problem

Traveling Salesman Problem

Unix Email

Unix Email

Weighted Graph

Weighted Graph

3D Drawing#

Image for: 3D Drawing#

Mayavi2

Mayavi2

Basic Animation

Basic Animation

Animation: Node Walk

Animation: Node Walk

Basic matplotlib

Basic matplotlib

Graphviz Layout#

Image for: 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#

Image for: 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#

Image for: Graph#

DAG - Topological Layout

DAG - Topological Layout

Degree Sequence

Degree Sequence

Erdos Renyi

Erdos Renyi

Expected Degree Sequence

Expected Degree Sequence

Football

Football

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#

Image for: Algorithms#

Beam Search

Beam Search

Betweenness Centrality

Betweenness Centrality

Bipartite Motifs: α/β-core

Bipartite Motifs: α/β-core

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#

Image for: External libraries#

Examples of using NetworkX with external libraries.

JavaScript

JavaScript

igraph

igraph

Geospatial#

Image for: 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.

Delaunay graphs from geographic points

Delaunay graphs from geographic points

Graphs from a set of lines

Graphs from a set of lines

OpenStreetMap with OSMnx

OpenStreetMap with OSMnx

Graphs from geographic points

Graphs from geographic points

Graphs from Polygons

Graphs from Polygons

Subclass#

Image for: Subclass#

Antigraph

Antigraph

Print Graph

Print Graph

Download all examples in Python source code: auto_examples_python.zip

Download all examples in Jupyter notebooks: auto_examples_jupyter.zip

Gallery generated by Sphinx-Gallery

On this page
  • Basic
  • Drawing
  • 3D Drawing
  • Graphviz Layout
  • Graphviz Drawing
  • Graph
  • Algorithms
  • External libraries
  • Geospatial
  • Subclass

© Copyright 2004-2025, NetworkX Developers.

Created using Sphinx 8.2.3.

Built with the PyData Sphinx Theme 0.16.1.