geosnap.visualize.animate_timeseries¶
- geosnap.visualize.animate_timeseries(gdf, column=None, filename=None, title='', temporal_index='year', time_periods=None, scheme='quantiles', k=5, cmap=None, legend=True, alpha=0.6, categorical=False, dpi=200, fps=0.5, interval=500, repeat_delay=1000, title_fontsize=40, subtitle_fontsize=38, figsize=(20, 20), ctxmap='default', plot_kwargs=None, color_col=None)[source]¶
Create an animated gif from a long-form geodataframe timeseries.
- Parameters:
- column
str
column to be graphed in a time series
- filename
str
, required output file name
- title
str
, optional desired title of figure
- temporal_index
str
, required column on the gdf that stores time periods
- time_periods: list, optional
subset of time periods to include in the animation. If None, then all times will be used
- scheme
str
, optional matplotlib scheme to be used default is ‘quantiles’
- k
int
, optional number of bins to graph. k may be ignored or unnecessary for some schemes, like headtailbreaks, maxp, and maximum_breaks Default is 5.
- legendbool, optional
whether to display a legend on the plot
- categoricalbool, optional
whether the data should be plotted as categorical as opposed to continuous
- alpha
float
, optional transparency parameter passed to matplotlib
- dpi
int
, optional dpi of the saved image if save_fig=True default is 500
- figsize
tuple
, optional the desired size of the matplotlib figure
- ctxmap
contextily
map
provider
, optional contextily basemap. Set to False for no basemap.
- figsize
tuple
, optional output figure size passed to matplotlib.pyplot
- fps
float
, optional frames per second, used to speed up or slow down animation
- interval
int
, optional interval between frames in miliseconds, default 500
- repeat_delay
int
, optional time before animation repeats in miliseconds, default 1000
- plot_kwargs: dict, optional
additional keyword arguments passed to geopandas.DataFrame.plot
- color_col: str, optional
A column on the geodataframe holding hex coodes used to color each observation. I.e. to create a categorical color-mapping manually
- column