Skip to main content

Rekha

The semantic plotting library for Python with publication-quality output

Documentation Discord PyPI


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.

📖 See all plot types in our documentation →

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/

Philosophy

Rekha follows these principles:

  1. Beautiful defaults - Plots should look professional without tweaking
  2. Simple API - Common tasks should be one-liners
  3. Full control - Complex customization should be possible
  4. 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.

Metadata

Release files for rekha 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rekha 0.0.2
File Size Uploaded
rekha-0.0.2.tar.gz 1.3 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for rekha 0.0.2
File Interpreter ABI Platform
rekha-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 1.3 MB

Release files / rekha-0.0.2.tar.gz

Download URL rekha-0.0.2.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
639c2349889f9bcc43bff32749338bfbebaaad55832a7fb3a1be5085a4940d06
BLAKE2b-256 checksum
How to use checksums
75057df25bd23a97ac691acf50bb9ba548246556e36c70a424967e7a3ec06f67
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 15, 2025.

Transparency log

Release files / rekha-0.0.2-py3-none-any.whl

Download URL rekha-0.0.2-py3-none-any.whl
Size 56.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d2adda2817e6a867109adadf0cdb81f95229146b31b5b3e3b2fbca97f649df31
BLAKE2b-256 checksum
How to use checksums
1652d60c5678ceb4b574344c59e55ba30bdd0bc04e4931dd6b49f1a9fab82609
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 15, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page