ppinard/matplotlib-scalebar

North Arrows and Scale Bars

Opened this issue · 1 comments

Less of an issue, more of an announcement for people using this library for cartographic visualization:

I just developed a package (matplotlib-map-utils) for adding print-ready north arrows to matplotlib plots. It includes a bevy of customization options, as well as the ability to automatically calculate the direction to "true north" if provided a CRS.

It is heavily inspired by this package, and thought it might be of interest to those using matplotlib-scalebar to create scale bars for maps specifically.

It seems development has also slowed on this package. I am hopeful that v2 of my package will include functionality for creating cartographic scale bars (like what is available in ArcGIS and QGIS) - if this is something you would use, feel free to drop a comment! I am not currently committing to any timeline for releasing v2, but if enough interest is expressed, I am happy to prioritize it over my other personal projects.

Most of all though, thank you to the developers of this package, as I was able to puzzle out a fair bit of functionality I re-used in my package thanks to the source code shared here!

Following up on this: I have created added functionality to create scale bars to the package (matplotlib-map-utils).

It features deep customization options, similar to what was available with north arrows in the same package.

A sample of how it works:

# Importing
from matplotlib_map_utils.core.scale_bar import ScaleBar, scale_bar
# Setting up a plot
fig, ax = matplotlib.pyplot.subplots(1,1, figsize=(5,5), dpi=150)
# Adding a scale bar to the upper-right corner of the axis, 
# in the same projection as whatever geodata you plotted
# Here, this scale bar will have the "boxes" style
scale_bar(ax=ax, location="upper right", style="boxes", bar={"projection":3857})

rendered scale bar

This doesn't really scratch the surface on how much everything can be customized: check out docs\howto_scale_bar in the GitHub repo to see more.