Installation

dartwork-mpl is a library of utilities and assets for matplotlib that makes creating publication-quality figures easier.

Quick Install

Install dartwork-mpl directly from GitHub. The package includes matplotlib style presets, curated color palettes, and layout utilities.

uv is a blazingly fast Python package manager written in Rust. It’s recommended for modern Python projects.

# Add to your project dependencies (Recommended)
# This automatically updates your pyproject.toml
uv add git+https://github.com/dartwork-repo/dartwork-mpl

# Or install directly into the current environment
uv pip install git+https://github.com/dartwork-repo/dartwork-mpl

# Install a specific branch or tag
uv add git+https://github.com/dartwork-repo/dartwork-mpl@main

Why uv? It’s 10-100x faster than pip, handles dependency resolution better, and integrates seamlessly with modern Python workflows.

Use the standard Python package installer. This works with any Python environment.

# Install from GitHub
pip install git+https://github.com/dartwork-repo/dartwork-mpl

# Upgrade to the latest version
pip install --upgrade git+https://github.com/dartwork-repo/dartwork-mpl

# Install a specific branch
pip install git+https://github.com/dartwork-repo/dartwork-mpl@main

Note: Make sure you have Git installed on your system, as pip needs it to clone the repository.

Basic Import

Once installed, import dartwork-mpl alongside matplotlib. The package is typically imported as dm for convenience.

example.py
import dartwork_mpl as dm
import matplotlib.pyplot as plt
import numpy as np

# Apply a style preset (Recommended)
dm.style.use('scientific')  # Academic papers

Available presets (from presets.json) are:

  • scientific, investment, presentation

  • scientific-kr, investment-kr, presentation-kr

Each preset layers one or more of the bundled styles from asset/mplstyle (e.g., base, dmpl, dmpl_light, font-*, lang-kr). See the Usage Guide for the exact mappings.

Verify Installation

After installation, verify that dartwork-mpl is properly installed and accessible:

verify.py
import dartwork_mpl as dm

# Check installed version
print(dm.__version__)  # Should print something like '0.1.1'

# List all available style files
dm.list_styles()  # ['base', 'dmpl', 'dmpl_light', 'font-investment', ...]

# Verify color palettes are available
print(len(dm.colors.PALETTES))  # Should show available color collections

If these commands run without errors, you’re all set! 🎉

Troubleshooting: If you encounter import errors, make sure:

  • Your Python environment is activated (if using virtual environments)

  • The package was installed in the correct environment

  • You have matplotlib installed as a dependency