Scale areas of a geopandas map by any property to create more intuitive and beautiful choropleth visualizations.
Project description
MapScaler
Scale areas of a geopandas map by any property (such as population) - without the shapes overlapping - to create more intuitive and beautiful choropleth visualizations.
Quick Start:
Suppose you have a GeoPandas Dataframe df
, including a column scaleby
that is a float column indicating how much each sample should grow or shrink to reflect each location's respective population. The goal is for the area of each location to visually portray it's contribution to the entire map for your chosen variable (population, in this example).
import mapscaler as ms
ss = ms.ShapeScaler()
scaled_df = ss.scale_map(df, 'scaleby')
The above code returns a new GeoPandas dataframe with an updated geometry column, with each shape's area having been scaled (up or down) to reflect its respective scalar.
Similarly, all shapes can be converted to circles before scaling by using the BubbleScaler:
import mapscaler as ms
bs = ms.BubbleScaler()
scaled_df = bs.scale_map(df, 'scaleby')
More realistically, you may need to tweak a few arguments to get an ideal map, depending on the distribution of your initial areas and the distribution of your scalars. See the documentation for full examples.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file mapscaler-0.0.4.tar.gz
.
File metadata
- Download URL: mapscaler-0.0.4.tar.gz
- Upload date:
- Size: 1.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1.post20200529 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 284e6a9ecf9911bdfc5a5b0b79279d2f7a4421c064ec0daf5661de9b2e713b96 |
|
MD5 | 33c5a949ad5b345dd644c33cfc9480ce |
|
BLAKE2b-256 | b619b3fdba63546412ed02a10df57ae627ea58af3502f7ee2919a5f208a15e21 |
File details
Details for the file mapscaler-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: mapscaler-0.0.4-py3-none-any.whl
- Upload date:
- Size: 1.7 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1.post20200529 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 042a5835d345b1edc799648a1ae76a9a2e141122f384bfc10c4c96d4e4cd868e |
|
MD5 | d1a4a25f810db8176a20e4b95c94fb03 |
|
BLAKE2b-256 | f6a84c09a3f50b9c2f96569025f33f66d30974378ebbd63895c2444c5dcd6cbb |