PySAL Visualization Project

Levi John Wolf edited this page Feb 16, 2017 · 10 revisions


This document will guide the development effort for the PySAL visualization layer. Currently residing in contrib, the goal of the layer is to provide simple (use- and dependency-wise) and lightweight conversion of PySAL structures into commonly used visualizations. The main use-cases that inspired and guide the development of the layer are:

  • "Interactive" data exploration (many static but easy plots that allow you to quickly iterate over ideas until finding the right one)
  • Teaching
  • (Publication-ready) static plots

Design and Components

The layer is composed of three main levels, each with a specific function in mind:

  • Low-level: convert PySAL geometries (Polygon, Line and Point) to Matplotlib geometries. This is mostly implemented already.
  • Mid-level: utilities where most of the PySAL functionality is implemented and applied to Matplotlib objects. This includes: subsetting (e.g. plot only part of a .shp), aligning (e.g. same axes for different layers) and transforming (e.g. classify values to colors) graphical objects. All the new functionality required to create the end-user views described below will live here.
  • High-level: end-user utilities that wrap generic functionality from the mid-level into specific views that visualize output from PySAL methods and classes.

This structure combines simplicity and ease of use, implemented in the end-user functions, with a great deal of flexibility implemented in the mid-level (just as in generic Matplotlib, if you know what you're doing, the sky is the limit).

Common Views

  • Maps
    • Choropleth
    • LISA
    • Join Count (BW)
    • Regression maps:
      • residual
      • fit & observed paired view
      • leverage
      • Indirect/Direct Effects map (sum of diagonal/off diagonal of filter matrix)
  • Scatter Plots
    • Moran
    • Space-Time LISA
    • Bivariate LISA
    • Pairwise regression plots
    • Four-plot statistical summary for regression
      • residual vs. fit
      • standard residual vs. fit
      • Quantile-Quantile
      • Residuals vs. leverage (if leverage is available)
    • Observed vs. simulated envelopes (e.g. King Tomz, and Wittenberg(2002), (KTW))
  • Densities
  • Lorenz Curve (GINI)
  • Rank Paths (graphs/networks)
  • Trajectory Paths
  • Rose Diagram
  • Directional LISA
  • Time series (spatial dynamics)
  • Point Patterns
  • Weights
    • Cardinalities
      • choropleths
      • histogram
    • graph/connectivity
    • slider for weights explorer
    • slider for distance weights


Our plan is to proceed in three stages.

  1. Prototype examples of a select view views using matplotlib
  2. Refine our design of these views based on prototype experience
  3. Design an API that could support use of PySAL with other visualization toolkits (i.e., D3, Bokeh, follium, future ipython Notebook interactivity).


You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.