plot_sites

site.SiteProblem.plot_sites(
    add_basemap=True,
    show_labels=True,
    interactive=False,
)

Generate a visualization of the candidate facility sites.

This method provides a quick way to inspect site locations. It supports both static matplotlib plots (with automatic label de-confliction) and interactive Folium maps.

Parameters

Name Type Description Default
add_basemap bool If True, adds a background web map using contextily. Only applicable for static plots (interactive=False). True
show_labels bool If True, adds text labels for each site using the candidate ID column. Labels are automatically wrapped and positioned to avoid overlap using adjust_text. Only applicable for static plots (interactive=False).. True
interactive bool If True, returns an interactive folium map via the .explore() method. False

Returns

Name Type Description
matplotlib.axes.Axes or folium.Map The plotting object. Returns an Axes object for static plots or a Map object for interactive visualizations.

Notes

Static plots use adjust_text to ensure that site labels remain legible even in high-density areas. Labels are title-cased and wrapped at a width of 15 characters.

Back to top