Beautiful matplotlib visualizations with a Plotly Express-like interface
Project description
Rekha
The semantic plotting library for Python with publication-quality output
One line of code. Publication-ready plots.
Rekha combines Plotly Express's intuitive API with matplotlib's powerful rendering engine, giving you beautiful visualizations without the boilerplate.
🚀 Quick Start
Installation
pip install rekha
Basic Usage
import rekha as rk
import pandas as pd
# Your data (any pandas DataFrame)
df = pd.read_csv('your_data.csv')
# One line = beautiful plot
fig = rk.scatter(df, x='x', y='y', color='category')
fig.show()
That's it! You now have publication-ready visualizations with zero configuration.
📊 Sample Graphs
Scatter Plot
rk.scatter(df, x='x', y='y', color='species')
Line Plot
rk.line(df, x='date', y='price', color='stock')
Bar Chart
rk.bar(df, x='category', y='sales', color='region')
Heatmap
rk.heatmap(correlation_matrix, text_auto=True)
Every plot type. Same simple API. Beautiful results.
Why Rekha Exists
The Plotting Library Dilemma:
- Matplotlib = Powerful but painful. Every plot requires 20+ lines of boilerplate.
- Plotly Express = has great semantics but limited customization and poor aesthetics for publications.
- Seaborn = Good defaults but restrictive API and complicated to use.
Rekha's Solution: Get the best of all worlds. Plotly Express semantics + matplotlib quality + unlimited customization.
✨ What Makes Rekha Special
🎯 One-Line Plots - Create publication-ready visualizations with a single function call
🎨 Intelligent Defaults - Beautiful themes that work in light mode, dark mode, and print
📊 All Plot Types - Line, scatter, bar, histogram, box, heatmap, CDF - unified API
🖨️ Print Perfection - Automatic grayscale optimization with patterns for accessibility
⚡ Zero Config - Works beautifully out of the box, customize when you need to
🔧 Unlimited Power - Full matplotlib access when you need advanced customization
Plot Types
Rekha supports all major statistical visualizations with a unified interface:
- Line plots - Time series, trends, multiple series
- Scatter plots - Relationships, correlations, bubble charts
- Bar charts - Categorical comparisons, grouped/stacked bars
- Histograms - Data distributions, density plots
- Box plots - Statistical summaries, outlier detection
- Heatmaps - 2D data, correlation matrices
- CDF plots - Cumulative distributions, percentile analysis
Key Features
Smart Export Formats
fig.save('plot.pdf', format='paper') # Publication PDF
fig.save('plot.svg', format='web') # Web-ready SVG
fig.save('plot.png', format='social') # High-res PNG
Theme Support
fig = rk.scatter(df, x='x', y='y', dark_mode=True) # Dark theme
fig = rk.bar(df, x='cat', y='val', grayscale_friendly=True) # Print-ready
Direct Customization
# Set axis limits directly
fig = rk.scatter(df, x='x', y='y', xlim=(0, 100), ylim=(-50, 50))
# Position legend outside plot
fig = rk.line(df, x='time', y='value', color='category',
legend_bbox_to_anchor=(1.05, 1))
# Full matplotlib access when needed
fig.get_axes()[0].axhline(y=0, color='red', linestyle='--')
📖 Documentation
Comprehensive documentation is available at: https://project-vajra.github.io/rekha/
- Quick Start Guide - Get up and running in minutes
- User Guide - Comprehensive feature documentation
- API Reference - Complete function reference
Philosophy
Rekha follows these principles:
- Beautiful defaults - Plots should look professional without tweaking
- Simple API - Common tasks should be one-liners
- Full control - Complex customization should be possible
- Performance - No unnecessary overhead
🤝 Contributing
We welcome contributions! Please see our Contributing Guide for detailed information on:
- Setting up development environment
- Code style and testing requirements
- Documentation standards
- Pull request process
Quick Development Setup
git clone https://github.com/project-vajra/rekha.git
cd rekha
# Install in development mode
make install-dev
# Install pre-commit hooks
pre-commit install
# Verify setup works
make format && make lint && make test
# See all available development commands
make help
Related Projects
Rekha is part of the Project Vajra ecosystem:
- Vajra - High-performance inference engine for large language models
- Rekha - Beautiful matplotlib visualizations (this project)
License
Apache License 2.0 - see LICENSE file for details.
Etymology
Rekha (रेखा) is a Sanskrit/Hindi word meaning "line", "stroke", or "diagram". It seemed fitting for a library focused on creating beautiful line plots, scatter plots, and other visualizations.
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 rekha-0.0.2.tar.gz.
File metadata
- Download URL: rekha-0.0.2.tar.gz
- Upload date:
- Size: 1.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
639c2349889f9bcc43bff32749338bfbebaaad55832a7fb3a1be5085a4940d06
|
|
| MD5 |
c6899d14fd30e12b069ab5f36696f1d7
|
|
| BLAKE2b-256 |
75057df25bd23a97ac691acf50bb9ba548246556e36c70a424967e7a3ec06f67
|
Provenance
The following attestation bundles were made for rekha-0.0.2.tar.gz:
Publisher:
publish_release.yml on project-vajra/rekha
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rekha-0.0.2.tar.gz -
Subject digest:
639c2349889f9bcc43bff32749338bfbebaaad55832a7fb3a1be5085a4940d06 - Sigstore transparency entry: 520640049
- Sigstore integration time:
-
Permalink:
project-vajra/rekha@9b8fa73c279bb4f5961846de5fc7ebc76b966747 -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/project-vajra
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_release.yml@9b8fa73c279bb4f5961846de5fc7ebc76b966747 -
Trigger Event:
release
-
Statement type:
File details
Details for the file rekha-0.0.2-py3-none-any.whl.
File metadata
- Download URL: rekha-0.0.2-py3-none-any.whl
- Upload date:
- Size: 56.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2adda2817e6a867109adadf0cdb81f95229146b31b5b3e3b2fbca97f649df31
|
|
| MD5 |
8793a37d0758eb94641d64b7b03d21d2
|
|
| BLAKE2b-256 |
1652d60c5678ceb4b574344c59e55ba30bdd0bc04e4931dd6b49f1a9fab82609
|
Provenance
The following attestation bundles were made for rekha-0.0.2-py3-none-any.whl:
Publisher:
publish_release.yml on project-vajra/rekha
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rekha-0.0.2-py3-none-any.whl -
Subject digest:
d2adda2817e6a867109adadf0cdb81f95229146b31b5b3e3b2fbca97f649df31 - Sigstore transparency entry: 520640058
- Sigstore integration time:
-
Permalink:
project-vajra/rekha@9b8fa73c279bb4f5961846de5fc7ebc76b966747 -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/project-vajra
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_release.yml@9b8fa73c279bb4f5961846de5fc7ebc76b966747 -
Trigger Event:
release
-
Statement type: