geosnap.visualize.plot_transition_graphs

geosnap.visualize.plot_transition_graphs(gdf, cluster_col=None, output_dir='.', w_type='queen', w_options=None, temporal_index='year', unit_index='geoid', permutations=0, layout='dot', args='-n -Groot=0 -Goverlap=false -Gnodesep=0.01 -Gfont_size=1 -Gmindist=3.5 -Gsize=30,30!', transition_model=None)[source]

Plot a network graph representation of global and spatially-conditioned transition matrices.

This function requires pygraphviz to be installed. For linux and macos, it can be installed with conda install -c conda-forge pygraphviz. At the time of this writing there is no pygraphviz build available for Windows from mainstream conda channels, but it can be installed with conda install -c alubbock pygraphviz

Parameters:
gdfgeopandas.GeoDataFrame

long-form geodataframe with a column holding labels appropriate for using as input to geosnap.analyze.transition

cluster_colstr

column on the gdf containing neighborhood type labels

output_dirstr

the location that output images will be placed

temporal_indexstr, optional

Column defining time and or sequencing of the long-form data. Default is “year”.

unit_indexstr, optional

Column identifying the unique id of spatial units. Default is “geoid”.

w_typestr, optional

Type of spatial weights type (“rook”, “queen”, “knn” or “kernel”) to be used for spatial structure. Default is None, if non-spatial Markov transition rates are desired.

w_optionsdict

additional options passed to a libpysal weights constructor (e.g. k for a KNN weights matrix)

permutationsint, optional

number of permutations for use in randomization based inference (the default is 0).

layoutstr, ‘dot’

graphviz layout for plotting

argsstr, optional

additional arguments passed to graphviz. default is “-n -Groot=0 -Goverlap=false -Gnodesep=0.01 -Gfont_size=1 -Gmindist=3.5 -Gsize=30,30!”

Returns
——
None