geosnap.visualize.plot_timeseries¶
- geosnap.visualize.plot_timeseries(gdf, column, title='', temporal_index='year', time_subset=None, scheme='quantiles', k=5, pooled=True, cmap=None, legend=True, categorical=False, save_fig=None, dpi=200, legend_kwds='default', missing_kwds='default', figsize=None, ncols=None, nrows=None, ctxmap='default', alpha=0.7, web_mercator=True)[source]¶
Plot an attribute from a geodataframe arranged as a timeseries with consistent colorscaling.
- Parameters:
- df
pandas.DataFrame
pandas dataframe with
- column
str
column to be graphed in a time series
- title
str
, optional desired title of figure
- temporal_index
str
, required name of column on dataframe that holds unique time periods default is every year in dataframe.
- schemestring,optional
matplotlib scheme to be used to create choropleth bins 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.
- pooledbool, optional
whether the classification should be pooled across time periods or unique to each. E.g. with a ‘quantile’ scheme, pooled=True indicates that quantiles should be identified on the entire time series, whereas pooled=False indicates that they should be calculated independently for each time period
- legendbool, optional
whether to display a legend on the plot
- categoricalbool, optional
whether the data should be plotted as categorical as opposed to continuous
- save_fig
str
, optional path to save figure if desired.
- dpi
int
, optional dpi of the saved image if save_fig=True default is 500
- legend_kwds
dictionary
, optional parameters for the legend
- missing_kwds
dictionary
, optional parameters for the plotting missing data Default is 1 column on the bottom of the graph.
- ncols
int
, optional number of columns in the figure if passing ncols, nrows must also be passed default is None
- nrows
int
, optional number of rows in the figure if passing nrows, ncols must also be passed default is None
- figsize
tuple
, optional the desired size of the matplotlib figure
- ctxmap
contextily
map
provider
, optional contextily basemap. Set to False for no basemap. Default is CartoDB.Positron
- alpha
int
(optional) Transparency parameter passed to matplotlib
- web_mercatorbool, optional
whether to reproject the data into web mercator (epsg 3857)
- df