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
Metadata
Release files for ggviews 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ggviews-0.2.0.tar.gz | 50.4 kB | Without provenance | Details for ggviews-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ggviews-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for ggviews-0.2.0-py3-none-any.whl |
Total release size: 108.9 kB
Release files / ggviews-0.2.0.tar.gz
| Download URL | ggviews-0.2.0.tar.gz |
|---|---|
| Size | 50.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c1997b783f59720b5d52b3051439125e0d7306d6ef7e374530d4696f3f3d0e7b
|
|
BLAKE2b-256 checksum How to use checksums |
a1897054888f4fb2bf9cadaedc1120844e463c130bfcea30735b77176caff22a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / ggviews-0.2.0-py3-none-any.whl
| Download URL | ggviews-0.2.0-py3-none-any.whl |
|---|---|
| Size | 58.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ab835122127297cdadea320ca74bc9eac055b0f062044f64f075811fde707cf1
|
|
BLAKE2b-256 checksum How to use checksums |
b4360851d702f58428debae19fddeaba2aa7bcbf7491f5b2fe77a467de288916
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Security for ggviews 0.2.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.