Skip to content

Commit 8e18889

Browse files
feat(altair): implement scatter-basic (#615)
## Implementation: `scatter-basic` - altair Implements the **altair** version of `scatter-basic`. **File:** `plots/scatter-basic/implementations/altair.py` **Parent Issue:** #611 --- :robot: *[impl-generate workflow](https://github.com/MarkusNeusinger/pyplots/actions/runs/20150014835)* --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 50b5e81 commit 8e18889

2 files changed

Lines changed: 48 additions & 0 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
"""
2+
scatter-basic: Basic Scatter Plot
3+
Library: altair
4+
"""
5+
6+
import altair as alt
7+
import numpy as np
8+
import pandas as pd
9+
10+
11+
# Data
12+
np.random.seed(42)
13+
x = np.random.randn(100) * 2 + 10
14+
y = x * 0.8 + np.random.randn(100) * 2
15+
16+
df = pd.DataFrame({"x": x, "y": y})
17+
18+
# Create chart
19+
chart = (
20+
alt.Chart(df)
21+
.mark_point(filled=True, size=100, opacity=0.7, color="#306998")
22+
.encode(x=alt.X("x:Q", title="X Value"), y=alt.Y("y:Q", title="Y Value"), tooltip=["x:Q", "y:Q"])
23+
.properties(width=1600, height=900, title="Basic Scatter Plot")
24+
.configure_axis(labelFontSize=16, titleFontSize=20, grid=True, gridOpacity=0.3)
25+
.configure_title(fontSize=20)
26+
)
27+
28+
# Save as PNG and HTML
29+
chart.save("plot.png", scale_factor=3.0)
30+
chart.save("plot.html")
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Per-library metadata for altair implementation of scatter-basic
2+
# Auto-generated by impl-generate.yml
3+
4+
library: altair
5+
specification_id: scatter-basic
6+
7+
preview_url: https://storage.googleapis.com/pyplots-images/plots/scatter-basic/altair/plot.png
8+
preview_html: https://storage.googleapis.com/pyplots-images/plots/scatter-basic/altair/plot.html
9+
10+
current:
11+
version: 0
12+
generated_at: 2025-12-11T22:54:30Z
13+
generated_by: claude-opus-4-5-20251101
14+
workflow_run: 20150014835
15+
issue: 611
16+
quality_score: 88
17+
18+
history: []

0 commit comments

Comments
 (0)