ggplot2 interface to holoviews
Project description
ggviews: A ggplot2-style API for holoviews
ggviews is a comprehensive Python library that brings the beloved ggplot2 grammar of graphics to Python, built on top of holoviews for interactive visualizations. Create publication-quality plots with the intuitive, layered syntax that R users know and love.
✨ Recent Major Updates (v0.3.0)
- 🎯 AUTOMATIC LEGENDS: Just like ggplot2 -
aes(color='species')now creates legends automatically - 📊 STATISTICAL GEOMS:
geom_boxplot(),geom_density()for comprehensive analysis - 🌈 COLORBREWER INTEGRATION: Professional publication palettes with
scale_colour_brewer() - 🎛️ ADVANCED THEMING:
theme()withelement_text(),element_blank()for fine control - 🗺️ GEOGRAPHIC MAPPING:
geom_map()with multiple projections and features - 🔄 COORDINATE SYSTEMS:
coord_flip()for horizontal layouts - 🔥 2D VISUALIZATION:
geom_tile(),geom_raster()for heatmaps and image data - 🔧 BUG FIXES: Resolved toolbar duplication, improved notebook display, fixed smooth placement
🎯 60% ggplot2 Coverage Achieved!
Features
✨ Familiar Syntax: Use the same grammar of graphics you know and love from ggplot2
🔗 Method Chaining: Build plots incrementally with intuitive method chaining
🎨 Rich Geoms: Support for all major geom types (point, line, bar, histogram, etc.)
🎭 Themes: Beautiful default themes matching ggplot2's aesthetics
🎯 Faceting: Powerful facet_wrap and facet_grid for subplotting
⚡ Interactive: Leverage holoviews' interactive capabilities
📊 Extensible: Easy to extend with custom geoms and themes
Installation
pip install ggviews
For development installation:
git clone https://github.com/ggviews/ggviews.git
cd ggviews
pip install -e ".[dev]"
Quick Start
from ggviews import ggplot, aes
import pandas as pd
# Load your data
df = pd.read_csv('your_data.csv')
# Create a beautiful plot with method chaining
(ggplot(df, aes(x='height', y='weight'))
.geom_point(aes(color='species'), size=3, alpha=0.7)
.geom_smooth(method='lm')
.theme_minimal()
.labs(
title='Height vs Weight by Species',
x='Height (cm)',
y='Weight (kg)'
)
.facet_wrap('~species'))
Core Concepts
Grammar of Graphics
ggviews implements the layered grammar of graphics:
- Data: Your pandas DataFrame
- Aesthetics: Map data to visual properties (x, y, color, size, etc.)
- Geometries: Visual representations of data (points, lines, bars, etc.)
- Scales: Control aesthetic mappings
- Themes: Overall visual styling
- Facets: Subplots based on data subsets
Method Chaining
Build plots incrementally:
plot = (ggplot(data)
.geom_point() # Add points
.geom_line() # Add lines
.theme_classic() # Apply theme
.labs(title='My Plot')) # Add labels
Available Geoms
geom_point()- Scatter plotsgeom_line()- Line plotsgeom_bar()- Bar chartsgeom_histogram()- Histogramsgeom_boxplot()- Box plotsgeom_violin()- Violin plotsgeom_density()- Density plotsgeom_smooth()- Smoothed conditional meansgeom_area()- Area plotsgeom_ribbon()- Ribbons/confidence bandsgeom_tile()- Heatmapsgeom_text()- Text annotations
Themes
theme_minimal()- Clean, minimal themetheme_classic()- Classic ggplot2 themetheme_bw()- Black and white themetheme_dark()- Dark themetheme_void()- Completely blank theme
Scales
scale_color_manual()- Manual color scalesscale_color_discrete()- Discrete color scalesscale_color_continuous()- Continuous color scalesscale_x_continuous()/scale_y_continuous()- Continuous axis scalesscale_x_discrete()/scale_y_discrete()- Discrete axis scales
Faceting
Create subplots with:
facet_wrap('~variable')- Wrap subplots in a gridfacet_grid('row_var ~ col_var')- Grid of subplots
Examples
Basic Scatter Plot
ggplot(df, aes(x='x', y='y')).geom_point()
Colored by Category
ggplot(df, aes(x='x', y='y', color='category')).geom_point()
Multiple Layers
(ggplot(df, aes(x='x', y='y'))
.geom_point()
.geom_smooth())
Faceted Plot
(ggplot(df, aes(x='x', y='y'))
.geom_point()
.facet_wrap('~group'))
Contributing
We welcome contributions! Please see our Contributing Guide for details.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
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 ggviews-0.2.0.tar.gz.
File metadata
- Download URL: ggviews-0.2.0.tar.gz
- Upload date:
- Size: 50.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c1997b783f59720b5d52b3051439125e0d7306d6ef7e374530d4696f3f3d0e7b
|
|
| MD5 |
fde6c40f03f1ead7edbe6a6736928292
|
|
| BLAKE2b-256 |
a1897054888f4fb2bf9cadaedc1120844e463c130bfcea30735b77176caff22a
|
File details
Details for the file ggviews-0.2.0-py3-none-any.whl.
File metadata
- Download URL: ggviews-0.2.0-py3-none-any.whl
- Upload date:
- Size: 58.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab835122127297cdadea320ca74bc9eac055b0f062044f64f075811fde707cf1
|
|
| MD5 |
582e69e30e0c253735abf51220692535
|
|
| BLAKE2b-256 |
b4360851d702f58428debae19fddeaba2aa7bcbf7491f5b2fe77a467de288916
|