geosnap.visualize.indexplot_seq

geosnap.visualize.indexplot_seq(df_traj, clustering, years=['1970', '1980', '1990', '2000', '2010'], k=None, ncols=3, palette='Set1', save_fig=None, dpi=500)[source]

Function for index plot of neighborhood sequences within each cluster.

Parameters:
df_trajdataframe

dataframe of trajectories

clusteringstr

column name of the sequence clustering to plot.

yearslist, optional

column names of cross sections of the neighborhood classifications. Default is decennial census years 1970-2010.

kint, optional

Number of neighborhood types. If None, k is obtained by inspecting unique values in “years”. Default is None.

ncolsint, optional

number of subplots per row. Default is 3.

paletteNone, str, or sequence, optional

Name of palette or None to return current palette. If a sequence, input colors are used but possibly cycled and desaturated. Default is “Set1”.

save_figstr, optional

path to save figure if desired

dpiint, optional

the dpi of the saved figure. Deafult is 500

Examples

>>> import pandas as pd
>>> from geosnap.visualize import indexplot_seq
>>> import matplotlib.pyplot as plt
>>> df_LA = pd.read_csv("../../examples/data/LA_sequences.csv", converters={'GEO2010': lambda x: str(x)})
>>> indexplot_seq(df_LA, clustering="seqC1", palette="pastel", ncols=3)
>>> plt.show()

(Source code, png, hires.png, pdf)

../_images/geosnap-visualize-indexplot_seq-1.png