Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customizing legends in vba_choropleth #173

Open
LSYS opened this issue Dec 6, 2022 · 0 comments
Open

Customizing legends in vba_choropleth #173

LSYS opened this issue Dec 6, 2022 · 0 comments
Labels

Comments

@LSYS
Copy link

LSYS commented Dec 6, 2022

Hi, is it possible to customize the legend's axis labels in splot's vba_choropleth?
(I'm referring to this guide: https://nbviewer.org/github/pysal/splot/blob/main/notebooks/mapping_vba.ipynb)

from libpysal import examples
import matplotlib.pyplot as plt
from splot.mapping import vba_choropleth
import geopandas as gpd

link_to_data = examples.get_path('columbus.shp')
gdf = gpd.read_file(link_to_data)

fig = plt.figure(figsize=(15,10))
ax = fig.add_subplot(111)
vba_choropleth('HOVAL', 'CRIME', gdf,
               alpha_mapclassify=dict(classifier='quantiles', k=5),
               rgb_mapclassify=dict(classifier='quantiles', k=5),
               legend=True, ax=ax)
plt.show()

image

For example, is it possible to change "alpha variable" to "HOVAL" and "rgb variable" to "crime"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants