Install & Compatibility
Where this runs
tested against v0.8.7 · 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.910 runs
installs and imports cleanly · install 0.0s · import 3.133s · 265.9MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 12.1s · import 2.969s · 255MB
269MB installed
● package 269MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Logo
✓ from logomaker import Logo
✗ import logomaker; logomaker.Logo
The Logo class is typically imported directly for clarity and common usage patterns.
get_example_matrix
✓ from logomaker import get_example_matrix
✗ import logomaker; logomaker.get_example_matrix
Utility function for loading example data, usually imported directly.
This quickstart demonstrates how to load an example sequence matrix, create a `Logo` object, and apply basic styling before displaying the logo using Matplotlib.
import logomaker
import matplotlib.pyplot as plt
import pandas as pd
# Load an example matrix (e.g., position-weight matrix)
# This returns a pandas DataFrame
example_df = logomaker.get_example_matrix('ww_matrix')
# Create a Logo object from the DataFrame
logo = logomaker.Logo(example_df)
# Customize the logo (optional)
logo.style_spines(visible=False)
logo.style_xticks(rotation=90, fmt='%d', anchor=0)
logo.highlight_position(p=6, color='gold')
logo.ax.set_ylabel('Information (bits)')
logo.ax.set_xlabel('Position')
logo.ax.set_title('RNA Binding Protein WW Domain Logo')
plt.tight_layout()
plt.show()
Errors
Common errors & fixes
AttributeError: module 'logomaker' has no attribute 'Logo'
You are trying to access the `Logo` class using `logomaker.Logo` after importing the module as `import logomaker`, but the `Logo` class is intended for direct import.
fixChange your import statement from `import logomaker` to `from logomaker import Logo`, and then use `Logo(...)` directly.
ValueError: Dataframe must have an index of positive integers.
The pandas DataFrame provided to the `logomaker.Logo` constructor (or related functions) does not have a numeric index, or the index contains non-positive integers. Logomaker expects the index to represent sequence positions.
fixEnsure your input DataFrame has a numeric index (e.g., `0, 1, 2...` or `1, 2, 3...`). You might need to use `df.reset_index(drop=True)` or `df.set_index(df.index + 1)` if your index is not suitable.
KeyError: 'A'
Your input DataFrame (e.g., a position-weight matrix) is missing columns for expected character labels (e.g., 'A', 'C', 'G', 'T' for DNA/RNA). Logomaker expects columns corresponding to the characters you want to represent.
fixEnsure your input pandas DataFrame has columns for all the characters you intend to display in the logo. For DNA/RNA, these are typically 'A', 'C', 'G', 'T' (or 'U'). For proteins, this would be the 20 standard amino acid codes.
Upgrade
Version history
0.8.7latest on PyPI · released Mar 25, 2025
Audit
Dependencies
matplotlibrequiredCore visualization library for rendering logos.
numpyrequiredFundamental package for numerical operations.
pandasrequiredUsed for data structures (DataFrames) to represent sequence matrices.
scipyrequiredProvides scientific computing tools, potentially for statistical analysis or data processing.