Install & Compatibility
Where this runs
tested against v3.1.8 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.920 runs
installs and imports cleanly · install 0.0s · import 3.425s · 318.9MB
glibcpy 3.10–3.920 runs
installs and imports cleanly · install 11.4s · import 3.252s · 306MB
321MB installed
● package 321MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
display_bins
✓ from plotbin.display_bins import display_bins
✗ import plotbin.display_bins
The primary plotting functions are typically imported directly from submodules, not the top-level package or as a single module object.
This quickstart demonstrates how to generate a binned 2D map using `plotbin.display_bins`. It simulates random x, y coordinates and associated 'z' values, then visualizes their binned representation with Matplotlib. It assumes a basic setup where x, y, and z represent data points and their corresponding values in a 2D space.
import numpy as np
from plotbin.display_bins import display_bins
import matplotlib.pyplot as plt
# Simulate some binned data (e.g., from a galaxy observation)
x = np.random.rand(100) * 10
y = np.random.rand(100) * 10
z = np.sin(x/2) + np.cos(y/2) + np.random.rand(100) * 0.5
# Create a simple display_bins plot
fig, ax = plt.subplots(figsize=(7, 6))
display_bins(x, y, z, ax=ax, cmap='viridis', textcolor='white')
ax.set_title('Example Binned Map with PlotBin')
ax.set_xlabel('X-coordinate')
ax.set_ylabel('Y-coordinate')
plt.colorbar(ax.collections[0], ax=ax, label='Value')
plt.show()
Debug
Known issues
breakingOlder versions of 'plotbin' might have used different import paths, potentially leading to `ImportError`. A changelog from a related project (pafit) noted 'Changed imports for plotbin as package'.fixEnsure you are using the correct submodule import paths as shown in recent examples, e.g., `from plotbin.display_bins import display_bins`. Refer to the latest file headers for definitive import patterns.
affects: <= 2.x (approximate, specific version unknown)
gotchaThe PlotBin library is distributed under a restrictive, non-commercial license. Permission to use is for non-commercial purposes only, and redistribution of the code is not allowed.fixReview the license details on PyPI or in the source code file headers to ensure compliance with usage restrictions, especially for commercial projects or redistribution.
affects: All versions
gotchaOfficial documentation for PlotBin is primarily contained within the file headers of the source code, rather than a separate documentation website or extensive README.fixWhen seeking detailed usage, function signatures, or examples, consult the source code files directly after installation or by browsing the project's homepage if available.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'plotbin.display_bins'
The `plotbin` package or the `display_bins` submodule is not installed or the import path is incorrect. This can happen if an older version of plotbin was installed or the package structure changed.
fixVerify that `plotbin` is installed (`pip show plotbin`). If installed, ensure your import statement matches the current package structure, e.g., `from plotbin.display_bins import display_bins`. If the error persists, consider reinstalling with `pip install --upgrade plotbin` to get the latest version.
TypeError: display_bins() got an unexpected keyword argument 'ax'
The `display_bins` function (or a similar plotting function) was called with an `ax` argument, but that specific version or function might not support directly passing a Matplotlib Axes object, or expects it as a positional argument.
fixCheck the function signature in the source code's file headers for the `display_bins` function to understand its expected arguments. If an `ax` argument is not supported, you might need to create the plot on the current active Axes or manually integrate it with Matplotlib's object-oriented interface. Update `plotbin` if a newer version supports the `ax` argument.
Upgrade
Version history
3.1.8latest on PyPI · released Sep 12, 2025
Audit
Dependencies
numpyrequiredRequired for numerical operations and data array handling, fundamental for binned map data.
matplotlibrequiredProvides the underlying plotting backend for generating visualizations.