A unified color scheme solution for Python visualization
Project description
Huez
A Unified Color Scheme Solution for Python Visualization
✨ Features •
🚀 Quick Start •
📚 Libraries •
🎨 Schemes
"Good visualizations should not be ruined by bad color schemes."
Huez is a unified Python visualization color scheme solution that instantly upgrades your charts from amateur to professional publication-quality.
True one-line code, automatic coloring for all libraries!
✨ Features
- 🚀 智能自动着色: 主要可视化库支持原生语法自动着色,无需手动指定颜色
- 🎯 完美跨库一致性: Matplotlib, Seaborn, plotnine, Altair, Plotly 统一的颜色体验
- 🎨 Rich Built-in & Custom Schemes: Professional academic palettes plus easy custom scheme creation and loading
- ⚡ Zero Learning Cost: Use native syntax of each library, no need to learn additional APIs
- 🔧 One Line Does It All: Just
hz.use("scheme-1")to enable automatic coloring for all libraries
🚀 Quick Start
Installation
pip install huez
Basic Usage
import huez as hz
# 🎨 One line of code, global coloring
hz.use("scheme-1")
# ✨ Now all libraries automatically color using native syntax!
📚 Supported Visualization Libraries
Matplotlib
import matplotlib.pyplot as plt
plt.plot(x, y1, label='Data 1') # Pure native syntax - colors auto-applied!
plt.plot(x, y2, label='Data 2') # Pure native syntax - colors auto-applied!
plt.legend()
Seaborn
import seaborn as sns
sns.scatterplot(data=df, x='x', y='y', hue='category') # Pure native syntax - colors auto-applied!
plotnine
from plotnine import *
(ggplot(df, aes('x', 'y', color='category')) +
geom_point()) # Pure native syntax - colors auto-applied!
Altair
import altair as alt
alt.Chart(df).mark_circle().encode(
x='x:Q', y='y:Q', color='category:N' # 使用huez主题颜色,配色自动优化!
)
Plotly
import plotly.graph_objects as go
fig = go.Figure()
fig.add_trace(go.Scatter(x=x, y=y, name='Data')) # Pure native syntax - colors auto-applied!
🎯 Multi-Scheme Visualization Showcase
See Huez's versatility with different color schemes across major libraries:
Matplotlib + scheme-1 (Academic)
Seaborn + scheme-2 (Alternative)
plotnine + scheme-3 (NEJM)
Altair - Interactive Portfolio Analysis
Interactive HTML chart: View Altair Demo
Plotly - 3D Investment Universe
Interactive 3D chart: View Plotly Demo
🎨 所有图表自动使用统一配色方案 - 大部分情况下无需手动指定颜色!
🎨 Rich Built-in & Custom Schemes
Huez comes with a rich collection of professional color schemes and supports easy customization:
✨ Custom Schemes
# Switch between built-in schemes
hz.use("lancet") # Academic journal style
hz.use("scheme-2") # Alternative color palette
# Load custom configuration file
hz.load_config("my_custom_config.yaml")
hz.use("my_custom_scheme")
Create custom config file (my_custom_config.yaml):
version: 1
default_scheme: my_custom_scheme
schemes:
my_custom_scheme:
title: "My Custom Style"
fonts: { family: "DejaVu Sans", size: 10 }
palettes:
discrete: "npg"
sequential: "viridis"
diverging: "coolwarm"
cyclic: "twilight"
figure: { dpi: 300 } # Set project-wide DPI, size is controlled in code
style: { grid: "y", legend_loc: "best", spine_top_right_off: true }
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
Third-Party Software Notices
This project uses the following open-source libraries:
Huez Core Dependencies:
- PyYAML (MIT License) - YAML configuration parsing
Copyright (c) 2017-2021 Ingy döt Net, Copyright (c) 2006-2016 Kirill SimonovHe was. - click (BSD-3-Clause License) - Command-line interface
Copyright 2014 Pallets
Demo Script Dependencies:
- NumPy - Copyright (c) 2005-2024, NumPy Developers - BSD-3-Clause License
- Pandas - Copyright (c) 2008-2024, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team - BSD-3-Clause License
- Matplotlib - Copyright (c) 2012-2024 Matplotlib Development Team - PSF License
- Seaborn - Copyright (c) 2012-2024, Michael Waskom - BSD-3-Clause License
- plotnine - Copyright (c) 2017-2024, Hassan Kibirige - MIT License
License Compliance: All third-party libraries are used in accordance with their respective licenses. For BSD-3-Clause and MIT licensed software, the above copyright notices and license terms are preserved. For PSF licensed software (Python and Matplotlib), this software is provided under the Python Software Foundation License.
We are grateful to the maintainers and contributors of these projects for their invaluable contributions to the open-source community.
Made with ❤️ for the Python visualization community
⭐ If this project helps you, please give us a star! ⭐
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 Distributions
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 huez-0.0.2-py3-none-any.whl.
File metadata
- Download URL: huez-0.0.2-py3-none-any.whl
- Upload date:
- Size: 54.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f077432cbc0fac2fd0d4febc3140896defb03e96eecaa47e161b6cd7da20c5bd
|
|
| MD5 |
04945f41beaee969c4af104068fcaac8
|
|
| BLAKE2b-256 |
e6264b6578710c645561e8dff3e49d3ba1b2714d7b497c367f76fa7d1338734d
|