ggviews: A ggplot2-style API for holoviews
October 2, 2025 ยท View on GitHub
ggviews is a comprehensive Python library that uses the ggplot2 grammar of graphics on top of holoviews for interactive visualizations. It is an option among other pacakges with similar goals like plotnine and lets-plot. ggviews was developped mostly with vibe coding to fulfill the need for an interactive ggplot2 interface in Pyodide environments.
Features
- Use the same grammar of graphics you know and love from ggplot2
- Build plots incrementally with method chaining such as
ggplot(data, aes(x='a', y='b')).geom_point() - Support for most geom types (point, line, bar, histogram, map, etc.), faceting, scales and themes
Installation
pip install ggviews
For development installation:
git clone https://github.com/essicolo/ggviews.git
cd ggviews
pip install -e ".[dev]"
Example
from ggviews import ggplot, aes
import pandas as pd
# Generate data
np.random.seed(42)
n = 100
df = pd.DataFrame({
'height': np.random.normal(170, 10, n),
'weight': np.random.normal(70, 15, n),
'species': np.random.choice(['faerie', 'orc', 'saurian'], n),
'age': np.random.randint(18, 80, n),
'group': np.random.choice(['A', 'B'], n)
})
# Add some correlation
df['weight'] = df['weight'] + 0.5 * (df['height'] - 170) + np.random.normal(0, 5, n)
# Plot
(
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')
)
License
This project is licensed under the MIT License.