MSU and Big Ten color palettes and themes for Python data visualization
Project description
MSUthemes
MSU and Big Ten color palettes and themes for Python data visualization.
Overview
MSUthemes is a Python package that provides color palettes and themes for Michigan State University and all Big Ten Conference institutions. It's designed to work seamlessly with popular Python visualization libraries including matplotlib, seaborn, and plotly.
This package is a Python port of the MSUthemes R package available on CRAN.
Features
- MSU Color Palettes: Sequential, diverging, and qualitative palettes using official MSU colors
- Big Ten Colors: Primary and secondary colors for all 18 Big Ten institutions
- Metropolis Font: Bundled with MSU's preferred font for consistent branding
- BigTen Dataset: Historical data (1996-2023) for all Big Ten institutions
- matplotlib Integration: Easy-to-use themes for matplotlib plots
- seaborn Support: Compatible with seaborn's styling system
- plotly Support: (Coming soon) Interactive visualizations with MSU branding
Installation
Install from PyPI:
pip install msuthemes
For optional dependencies:
# With seaborn support
pip install msuthemes[seaborn]
# With plotly support
pip install msuthemes[plotly]
# Install all optional dependencies
pip install msuthemes[all]
For development:
git clone https://github.com/emilioxavier/msuthemes-py.git
cd msuthemes-py
pip install -e .[dev]
Quick Start
Basic Usage with matplotlib
import matplotlib.pyplot as plt
from msuthemes import theme_msu, colors
import numpy as np
# Apply MSU theme
theme_msu()
# Create a simple plot
x = np.linspace(0, 10, 100)
y = np.sin(x)
fig, ax = plt.subplots(figsize=(8, 6))
ax.plot(x, y, color=colors.MSU_GREEN, linewidth=2)
ax.set_xlabel('X axis')
ax.set_ylabel('Y axis')
ax.set_title('MSU-Branded Plot')
plt.show()
Using MSU Color Palettes
from msuthemes import palettes
# Use sequential palette
colors = palettes.msu_seq.as_hex(n_colors=5)
# Use diverging palette
colors_div = palettes.msu_div.as_hex(n_colors=7)
# Use qualitative palette
colors_qual = palettes.msu_qual1.as_hex()
Big Ten Colors
from msuthemes import get_bigten_colors
# Get single institution color
msu_color = get_bigten_colors("MSU")
# Get multiple institution colors
colors = get_bigten_colors(["MSU", "Michigan", "Ohio State"])
# Returns: {'MSU': '#18453B', 'Michigan': '#00274C', 'Ohio State': '#BB0000'}
Using Metropolis Font
The Metropolis font is bundled with MSUthemes and can be easily registered with matplotlib:
from msuthemes import register_metropolis_fonts
import matplotlib.pyplot as plt
# Register Metropolis font with matplotlib
register_metropolis_fonts()
# Use Metropolis in your plots
plt.rcParams['font.family'] = 'Metropolis'
# Create plot with Metropolis font
fig, ax = plt.subplots()
ax.plot([1, 2, 3], [1, 4, 2])
ax.set_title('Plot with Metropolis Font', fontsize=16, weight='bold')
ax.set_xlabel('X Axis', fontsize=12)
plt.show()
Check if Metropolis is available:
from msuthemes import is_metropolis_available
if is_metropolis_available():
print("Metropolis font is ready!")
The Metropolis font includes 18 font files with 9 weights (100-900), each with normal and italic variants. See fonts documentation for more details.
BigTen Dataset
MSUthemes includes historical data (1996-2023) for all 18 Big Ten Conference institutions from the College Scorecard:
from msuthemes import load_bigten_data, get_bigten_summary
# Load all data (504 rows × 38 columns)
df = load_bigten_data()
# Filter for specific institutions (supports aliases)
msu_data = load_bigten_data(institutions=['MSU'])
rivalries = load_bigten_data(institutions=['MSU', 'Michigan', 'Ohio State'])
# Filter by years
recent = load_bigten_data(years=[2020, 2021, 2022, 2023])
# Combine filters and select columns
msu_recent = load_bigten_data(
institutions=['MSU'],
years=[2020, 2021, 2022, 2023],
columns=['name', 'entry_term', 'UGDS', 'ADM_RATE', 'TUITIONFEE_IN']
)
# Get summary statistics
summary = get_bigten_summary()
print(summary)
The dataset includes:
- Enrollment data: Total, by gender, by race/ethnicity
- Admission rates: Percentage of applicants admitted
- Completion rates: 4-year completion percentage
- Tuition and fees: In-state and out-of-state
- Cost of attendance: Total estimated costs
- Demographics: Student body composition
Color Palettes
MSU Primary Colors
- MSU Green:
#18453B - MSU White:
#FFFFFF
MSU Secondary Colors
- MSU Black:
#000000 - MSU Silver:
#C1C6C8 - MSU Gray:
#909090
MSU Accent Colors
- MSU Orange:
#D14D28 - MSU Teal:
#005F83 - MSU Grellow:
#849E2A
Big Ten Institutions
The package includes colors for all 18 Big Ten institutions:
- Illinois
- Indiana
- Iowa
- Maryland
- Michigan
- Michigan State (MSU)
- Minnesota
- Nebraska
- Northwestern
- Ohio State
- Oregon
- Penn State
- Purdue
- Rutgers
- UCLA
- USC
- Washington
- Wisconsin
Documentation
Full documentation is available at: https://emilioxavier.github.io/msuthemes-py/
Examples
See the examples/ directory for comprehensive usage examples:
basic_usage.py- Simple MSU-branded plotsmsu_plots.py- Various plot types with MSU themesbigten_comparisons.py- Comparing Big Ten institutions
Development Status
MSUthemes is currently in alpha development (v0.1.0). The API may change in future releases.
Roadmap
- Phase 1: Project setup and infrastructure
- Phase 2: Color system implementation
- Phase 3: Metropolis font integration
- Phase 4: matplotlib/seaborn themes
- Phase 5: Big Ten functionality
- Phase 6: BigTen dataset integration
- Phase 7: Documentation
- Phase 8: Test suite
- Phase 9: Examples and tutorials
- Phase 10: PyPI publication
Related Projects
- MSUthemes R package (CRAN) - Original R implementation
- MSUthemes R package (GitHub)
License
This project is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License (CC BY-SA 4.0).
See LICENSE for more information.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Citation
If you use MSUthemes in your research or publications, please cite:
@software{msuthemes_python,
author = {Esposito, Emilio Xavier},
title = {MSUthemes: MSU and Big Ten Color Palettes and Themes for Python},
year = {2025},
url = {https://github.com/emilioxavier/msuthemes-py}
}
Contact
- Author: Emilio Xavier Esposito
- Email: emilio.esposito@gmail.com
- GitHub: https://github.com/emilioxavier/msuthemes-py
- Issues: https://github.com/emilioxavier/msuthemes-py/issues
Acknowledgments
- Michigan State University for brand guidelines and color specifications
- The Big Ten Conference for institutional color information
- The original MSUthemes R package and its contributors
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file msuthemes-0.2.0.tar.gz.
File metadata
- Download URL: msuthemes-0.2.0.tar.gz
- Upload date:
- Size: 646.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0476915bf94c1dfccd7e3c934d7e821250a34182c34b5de5333657df017f3c38
|
|
| MD5 |
46ceff197938252f19cfd62d19fd4c80
|
|
| BLAKE2b-256 |
6a15dc3ab072754f2659f72e944868be5ed113f7f20da832d0e339e825e5cc94
|
File details
Details for the file msuthemes-0.2.0-py3-none-any.whl.
File metadata
- Download URL: msuthemes-0.2.0-py3-none-any.whl
- Upload date:
- Size: 628.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21b741b4629793933553350bf472283d12c54e64011f3bd246fcab67bcdfaf91
|
|
| MD5 |
1693d448fc54aab18b6d7768e02bb1b4
|
|
| BLAKE2b-256 |
bd394a58ca3904da68035c0fbf4ec70377d7a75f8d89daccb17c5c2eb28f79cc
|