Welcome to splot’s documentation!

Release

1.1.3

Date

Mar 23, 2020

splot provides PySAL users with a lightweight visualization interface to explore their data and quickly iterate through static and dynamic visualisations.

Installation

Installing dependencies

splot is compatible with Python 3.6 and 3.7 and depends on GeoPandas 0.4.0 or later and matplotlib 2.2.2 or later. Please make sure that you are operating in a Python 3 environment.

splot also uses

  • numpy

  • seaborn

  • mapclassify

  • Ipywidgets

Depending on your spatial analysis workflow and the PySAL objects you would like to visualize, splot relies on:

PySAL >=2.0

or the installation of separate packages found in the PySAL stack:

  • esda

  • libpysal

  • spreg

  • giddy

Installing the newest release

There are two ways of accessing splot. First, splot is installed with the PySAL 2.0 metapackage through:

`$ pip install -U pysal`

or

`$ conda install -c conda-forge pysal`

Second, splot can be installed as a separate package. If you are using Anaconda, install splot via the conda utility:

`$ conda install -c conda-forge splot`

Otherwise, you can install splot from PyPI with pip:

`$ pip install splot`

Troubleshooting

Most common installation errors are due to splot’s dependency on GeoPandas.

It often helps to first install GeoPandas separately from conda-forge with:

`$ conda install --channel conda-forge geopandas`

before installing splot (preferably also from conda, alternatively from pip).

For more information on troubleshooting the installation of GeoPandas with pip, see the GeoPandas docuemntation.

It is also possible to install splot with a later Python version (>3.7) through the separate installation of GeoPandas or through installation with conda-forge. (Note that splot is currently only tested for Python version 3.6 and 3.7)

Installing the development version

Potentially, you might want to use the newest features in the development version of splot on github - pysal/splot while have not been incorporated in the Pypi released version. You can achieve that by installing pysal/splot by running the following from a command shell:

pip install git+https://github.com/pysal/splot.git

You can also fork the pysal/splot repo and create a local clone of your fork. By making changes to your local clone and submitting a pull request to pysal/splot, you can contribute to the splot development.

API reference

splot.giddy

Provides visualisations for the Geospatial Distribution Dynamics - giddy module. giddy provides a tool for space–time analytics that consider the role of space in the evolution of distributions over time.

Directional LISA analytics

dynamic_lisa_heatmap(rose[, p, ax])

Heatmap indicating significant transition of LISA values over time inbetween Moran Scatterplot quadrants

dynamic_lisa_rose(rose[, attribute, ax])

Plot dynamic LISA values in a rose diagram.

dynamic_lisa_vectors(rose[, ax, arrows])

Plot vectors of positional transition of LISA values in Moran scatterplot

dynamic_lisa_composite(rose, gdf[, p, figsize])

Composite visualisation for dynamic LISA values over two points in time.

dynamic_lisa_composite_explore(rose, gdf[, …])

Interactive exploration of dynamic LISA values for different dates in a dataframe.

splot.esda

Provides visualisations for the esda subpackage. esda provides tools for exploratory spatial data analysis that consider the role of space in a distribution of attribute values.

Moran analytics

moran_scatterplot(moran[, zstandard, p, …])

Moran Scatterplot

plot_moran_simulation(moran[, aspect_equal, …])

Global Moran’s I simulated reference distribution.

plot_moran(moran[, zstandard, aspect_equal, …])

Global Moran’s I simulated reference distribution and scatterplot.

plot_moran_bv_simulation(moran_bv[, ax, …])

Bivariate Moran’s I simulated reference distribution.

plot_moran_bv(moran_bv[, aspect_equal, …])

Bivariate Moran’s I simulated reference distribution and scatterplot.

lisa_cluster(moran_loc, gdf[, p, ax, …])

Create a LISA Cluster map

plot_local_autocorrelation(moran_loc, gdf, …)

Produce three-plot visualisation of Moran Scatteprlot, LISA cluster and Choropleth maps, with Local Moran region and quadrant masking

moran_facet(moran_matrix[, figsize, …])

Moran Facet visualization.

splot.libpysal

Provides visualisations for all core components of Python Spatial Analysis Library in libpysal.

libpysal weights

plot_spatial_weights(w, gdf[, indexed_on, …])

Plot spatial weights network.

splot.mapping

Provides Choropleth visualizations and mapping utilities.

Value-by-Alpha maps

value_by_alpha_cmap(x, y[, cmap, …])

Calculates Value by Alpha rgba values

vba_choropleth(x_var, y_var, gdf[, cmap, …])

Value by Alpha Choropleth

vba_legend(rgb_bins, alpha_bins, cmap[, ax])

Creates Value by Alpha heatmap used as choropleth legend.

mapclassify_bin(y, classifier[, k, pct, …])

Classify your data with pysal.mapclassify Note: Input parameters are dependent on classifier used.

Colormap utilities

shift_colormap(cmap[, start, midpoint, …])

Function to offset the “center” of a colormap.

truncate_colormap(cmap[, minval, maxval, n])

Function to truncate a colormap by selecting a subset of the original colormap’s values

References

Indices and tables