matplotlib-scalebar
Artist for matplotlib to display a scale bar
Decision gist · record as of 2026-08-14
Yes. Low install friction, no security issues, permissive license, and recent maintenance make it a safe choice. Install if you regularly plot calibrated images and need a standard way to display scale information; skip if you never use imshow() or prefer manual annotation.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires matplotlib as a runtime dependency.
- Low friction: single runtime dependency on matplotlib, pure Python wheel.
- Repository shows recent activity (last commit 2025-01-17) and stable release history since 2016, though marked dormant.
License · maintenance · safety
permissive license (permissive) — Permissive license (BSD) allows use in commercial and proprietary projects with minimal restrictions.
last release 2025-01-17 (574 days) · last repo commit 2025-01-17 · 171 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 148,860 downloads/mo, #11,016 on PyPI
Alternatives
Verify before relying
pip install matplotlib-scalebar
import matplotlib.pyplot as plt
from matplotlib_scalebar.scalebar import ScaleBar
fig, ax = plt.subplots()
ax.imshow(image_array, cmap="gray")
scalebar = ScaleBar(0.08, "cm", length_fraction=0.25)
ax.add_artist(scalebar)
plt.show()- Whether the package supports all matplotlib backends equally or has known limitations with certain renderers.
- Performance characteristics when rendering scale bars on very large images or in animation loops.
- Full extent of customization options beyond those shown in the provided examples.
What it is and what it does
matplotlib-scalebar extends matplotlib with a new artist class that overlays a scale bar on plots, primarily for displaying calibrated images via imshow(). You specify the pixel size (dx) and its units, and the package automatically renders an appropriately-scaled bar with optional labels, customizable positioning, and support for multiple unit systems (SI length, imperial, astronomical, angle, pixel-based, and reciprocal dimensions).
The scale bar integrates directly into matplotlib's artist system—you create a ScaleBar object, add it to an axes via add_artist(), and configure appearance through constructor arguments or matplotlibrc settings. It's designed for scientific imaging workflows where pixel dimensions are known and need visual representation on output plots or saved figures.
Use it for
- Annotate microscopy images with a calibrated scale bar showing micrometers or nanometers.
- Display geospatial plots with distance references using UTM or lat/lon coordinate systems.
- Save publication-quality scientific figures with scale information preserved at original resolution.
- Add dimension references to satellite or aerial imagery without modifying the underlying data.
- Customize scale bar appearance to match journal or presentation requirements.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Low install friction, no security issues, permissive license, and recent maintenance make it a safe choice. Install if you regularly plot calibrated images and need a standard way to display scale information; skip if you never use imshow() or prefer manual annotation.
Install
matplotlib-scalebar on PyPI
Before you install
Low friction: single runtime dependency on matplotlib, pure Python wheel. Repository shows recent activity (last commit 2025-01-17) and stable release history since 2016, though marked dormant.
Requires matplotlib as a runtime dependency.
License in practice
Permissive license (BSD) allows use in commercial and proprietary projects with minimal restrictions.
Quickstart
pip install matplotlib-scalebar
import matplotlib.pyplot as plt
from matplotlib_scalebar.scalebar import ScaleBar
fig, ax = plt.subplots()
ax.imshow(image_array, cmap="gray")
scalebar = ScaleBar(0.08, "cm", length_fraction=0.25)
ax.add_artist(scalebar)
plt.show()
Verify before relying
- Whether the package supports all matplotlib backends equally or has known limitations with certain renderers.
- Performance characteristics when rendering scale bars on very large images or in animation loops.
- Full extent of customization options beyond those shown in the provided examples.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagematplotlib |
| Maintenance | Dormant 574 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 148,860 / month, #11,016 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableFramework :: MatplotlibIntended Audience :: Science/ResearchLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.9Topic :: Scientific/Engineering :: Visualization |
Evidence: matplotlib_scalebar-0.9.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “matplotlib scale bar”
- matplotlib-scalebarAdds a matplotlib artist that renders a calibrated scale bar on…
- termplotlibtermplotlib renders line plots, histograms, and bar charts directly…
- alchemlybalchemlyb parses molecular dynamics simulation output, extracts…
Give your agent the search over MCP, or paste the wish link into any chat.
More Visualization packages
matplotlib creates static, animated, and interactive visualizations in Python, producing publication-quality figures in multiple formats for scripts, shells, web servers, and graphical interfaces.
Install it if you need to visualize data, generate publication-quality figures, or embed plots in applications.
ContourPy calculates contours of 2D quadrilateral grids using C++11 algorithms wrapped in Python, offering serial and multithreaded implementations without requiring Matplotlib as a dependency.
Plotly is an interactive, browser-based graphing library that creates charts and visualizations from Python, rendering them as HTML that can be viewed in Jupyter notebooks, standalone files, or web applications.
Generates DOT language source code for graph structures and renders them using the Graphviz graph drawing software installed on your system.
Install it if you need to generate or render graphs from Python.
Streamlit transforms Python scripts into interactive web applications with minimal code, enabling rapid development of data dashboards, reports, and chat interfaces without requiring web development expertise.
Leather is a lightweight Python charting library for quick, no-frills data visualization. It generates charts without requiring perfect styling or extensive configuration.
See also koreanize-matplotlib · progressbar33 · lovelyplots · palettable · cmcrameri · hist · cmap · japanize-matplotlib