Skip to content

Customizing legends in vba_choropleth #173

@LSYS

Description

@LSYS

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"?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions