- Notifications
You must be signed in to change notification settings - Fork11
Legendgrams are distributional visualizations for map classification schemes
License
pysal/legendgram
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
legendgram is archived.
Its functionality is integrated intomapclassify as a classifier instance method.For example:
>>>importgeopandas,libpysal,mapclassify>>>gdf=geopandas.read_file(libpysal.examples.get_path("NAT.shp"))>>>ax=gdf.plot("GI89")>>>classifier=mapclassify.EqualInterval(gdf["GI89"])>>>classifier.plot_legendgram(ax=ax)
This is a small bit of unittested, reproducible code to provide legendgrams.Legendgrams are map legends that visualize the distribution of observations by color in a given map:
Legendgrams are distributed by PySAL, an open source cross-platform library of spatial analysis functionswritten in Python. It is intended to support the development of high levelapplications for spatial analysis.
To use legendgrams, simply install the package using pip:
$ pip install legendgram
Then, apply the function to the figure/axis you want to have a legendgram:
>>>importmapclassifyasmpc,geopandasasgpd,matplotlib.pyplotasplt>>>fromlegendgramimportlegendgram>>>data=gpd.read_file(ps.examples.get_path('south.shp'))>>>data.crs= {'init':'epgs:4269'}>>>data.to_crs(epsg=5070)>>>f,ax=plt.subplots()>>>data.plot('DV80',k=10,ax=ax,scheme='Quantiles')>>>bins=mpc.Quantiles(data['DV80'].values,k=10).bins>>>fromlegendgramimportlegendgram>>>importpalettable.matplotlibaspalmpl>>>legendgram(f,ax,data['DV80'],bins,pal=palmpl.Viridis_10,legend_size=(.5,.2),# legend size in fractions of the axisloc='upper left'# matplotlib-style legend locationsclip= (2,10)# clip the displayed range of the histogram )
An example notebook isprovided as well.
This is licensed under the 3-Clause BSD license.Refer to the license file for more details.
About
Legendgrams are distributional visualizations for map classification schemes
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors5
Uh oh!
There was an error while loading.Please reload this page.