logo
  • Install
  • Tutorial
  • Reference
  • Releases
  • Developer
  • Gallery
  • Guides
    • devel (latest)
    • current (stable)
On this page
  • Basic
  • Drawing
  • 3D Drawing
  • Graphviz Layout
  • Graphviz Drawing
  • Graph
  • Algorithms
  • External libraries
  • Geospatial
  • Subclass

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¶

Chess Masters

Chess Masters¶

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¶

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¶

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¶

Degree Sequence

Degree Sequence¶

Erdos Renyi

Erdos Renyi¶

Expected Degree Sequence

Expected Degree Sequence¶

Football

Football¶

Karate Club

Karate Club¶

Napoleon Russian Campaign

Napoleon Russian Campaign¶

Roget

Roget¶

Words/Ladder Graph

Words/Ladder Graph¶

Algorithms¶

Beam Search

Beam Search¶

Betweeness Centrality

Betweeness Centrality¶

Blockmodel

Blockmodel¶

Circuits

Circuits¶

Davis Club

Davis Club¶

Dedensification

Dedensification¶

Iterated Dynamical Systems

Iterated Dynamical Systems¶

Krackhardt Centrality

Krackhardt Centrality¶

Parallel Betweenness

Parallel Betweenness¶

Reverse Cuthill--McKee

Reverse Cuthill–McKee¶

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.

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¶

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

© Copyright 2004-2022, NetworkX Developers.

Created using Sphinx 4.4.0.