Skip to main content
This page is documentation for a DEVELOPMENT / PRE-RELEASE version. Switch to stable version
Ctrl+K

NetworkX User Survey 2023 🎉 Fill out the survey to tell us about your ideas, complaints, praises of NetworkX!

Logo image Logo image

Site Navigation

  • Install
  • Tutorial
  • Reference
  • Gallery
  • Developer
  • Releases
  • Guides
    • devel (latest)
    • current (stable)

Site Navigation

  • Install
  • Tutorial
  • Reference
  • Gallery
  • Developer
  • Releases
  • Guides
    • devel (latest)
    • current (stable)

Gallery#

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

Basic#

Properties

Properties

Properties
Read and write graphs.

Read and write graphs.

Read and write graphs.
Simple graph

Simple graph

Simple graph

Drawing#

Custom Node Position

Custom Node Position

Custom Node Position
Chess Masters

Chess Masters

Chess Masters
Custom node icons

Custom node icons

Custom node icons
Degree Analysis

Degree Analysis

Degree Analysis
Directed Graph

Directed Graph

Directed Graph
Edge Colormap

Edge Colormap

Edge Colormap
Ego Graph

Ego Graph

Ego Graph
Eigenvalues

Eigenvalues

Eigenvalues
Four Grids

Four Grids

Four Grids
House With Colors

House With Colors

House With Colors
Knuth Miles

Knuth Miles

Knuth Miles
Labels And Colors

Labels And Colors

Labels And Colors
Multipartite Layout

Multipartite Layout

Multipartite Layout
Node Colormap

Node Colormap

Node Colormap
Rainbow Coloring

Rainbow Coloring

Rainbow Coloring
Random Geometric Graph

Random Geometric Graph

Random Geometric Graph
Sampson

Sampson

Sampson
Self-loops

Self-loops

Self-loops
Simple Path

Simple Path

Simple Path
Spectral Embedding

Spectral Embedding

Spectral Embedding
Traveling Salesman Problem

Traveling Salesman Problem

Traveling Salesman Problem
Unix Email

Unix Email

Unix Email
Weighted Graph

Weighted Graph

Weighted Graph

3D Drawing#

Mayavi2

Mayavi2

Mayavi2
Basic matplotlib

Basic matplotlib

Basic matplotlib

Graphviz Layout#

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

Atlas

Atlas

Atlas
Circular Tree

Circular Tree

Circular Tree
Decomposition

Decomposition

Decomposition
Giant Component

Giant Component

Giant Component
Lanl Routes

Lanl Routes

Lanl Routes

Graphviz Drawing#

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

Attributes

Attributes

Attributes
Conversion

Conversion

Conversion
2D Grid

2D Grid

2D Grid
Atlas

Atlas

Atlas

Graph#

DAG - Topological Layout

DAG - Topological Layout

DAG - Topological Layout
Degree Sequence

Degree Sequence

Degree Sequence
Erdos Renyi

Erdos Renyi

Erdos Renyi
Expected Degree Sequence

Expected Degree Sequence

Expected Degree Sequence
Football

Football

Football
Karate Club

Karate Club

Karate Club
Morse Trie

Morse Trie

Morse Trie
Napoleon Russian Campaign

Napoleon Russian Campaign

Napoleon Russian Campaign
Roget

Roget

Roget
Triads

Triads

Triads
Words/Ladder Graph

Words/Ladder Graph

Words/Ladder Graph

Algorithms#

Beam Search

Beam Search

Beam Search
Betweenness Centrality

Betweenness Centrality

Betweenness Centrality
Blockmodel

Blockmodel

Blockmodel
Circuits

Circuits

Circuits
Davis Club

Davis Club

Davis Club
Dedensification

Dedensification

Dedensification
Iterated Dynamical Systems

Iterated Dynamical Systems

Iterated Dynamical Systems
Krackhardt Centrality

Krackhardt Centrality

Krackhardt Centrality
Parallel Betweenness

Parallel Betweenness

Parallel Betweenness
Reverse Cuthill--McKee

Reverse Cuthill–McKee

Reverse Cuthill--McKee
SNAP Graph Summary

SNAP Graph Summary

SNAP Graph Summary
Subgraphs

Subgraphs

Subgraphs

External libraries#

Examples of using NetworkX with external libraries.

Javascript

Javascript

Javascript
igraph

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.

Delaunay graphs from geographic points

Delaunay graphs from geographic points

Delaunay graphs from geographic points
Graphs from a set of lines

Graphs from a set of lines

Graphs from a set of lines
OpenStreetMap with OSMnx

OpenStreetMap with OSMnx

OpenStreetMap with OSMnx
Graphs from geographic points

Graphs from geographic points

Graphs from geographic points
Graphs from Polygons

Graphs from Polygons

Graphs from Polygons

Subclass#

Antigraph

Antigraph

Antigraph
Print Graph

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

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

© Copyright 2004-2023, NetworkX Developers.

Built with the PyData Sphinx Theme 0.12.0.

Created using Sphinx 5.2.3.