altair
Guide and best practices for creating data visualizations using Altair in Python. Always use this over matplotlib or seaborn.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Guide and best practices for creating data visualizations using Altair in Python. Always use this over matplotlib or seaborn.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Analyze agent session transcripts to find looping behavior, missing capabilities, or token waste, and leverage framework-native concepts and skill-creator patterns to propose optimizations.
Build multi-agent systems using Google ADK with A2A protocol, deployed on Agent Engine. Use when creating agents that communicate via A2A, building multi-tier agent hierarchies, connecting ADK agents with RemoteA2aAgent, exposing agents with to_a2a(), or deploying agent stacks to Vertex AI Agent Engine. Covers leaf agents with tools, functional agents that delegate, orchestrators that route, local testing with uvicorn, and phased cloud deployment.
Build AI agents using Google's Agent Development Kit (ADK). Use when creating LLM agents with tools, building workflow agents (Sequential, Parallel, Loop), composing multi-agent systems, or developing custom agents. Covers agent creation patterns, function tools, agent configuration, session management, and running agents locally with CLI or web interface.
Deploy and manage AI agents on Vertex AI Agent Engine. Use when deploying ADK agents to production, configuring Agent Engine runtime, managing deployed agents, setting up sessions and memory, or integrating with A2A protocol. Covers deployment from agent objects and source files, environment configuration, scaling, sessions, memory bank, and agent management operations.
Sprint-based agile development with parallel agent execution. Use when the user wants to run an agile sprint, plan sprint work, conduct standups, run retrospectives, manage a backlog, estimate story points, track velocity, or coordinate parallel development across multiple agents acting as Scrum team roles (Scrum Master, Product Owner, Tech Lead, Frontend Dev, Backend Dev, QA Engineer). Also use when the user mentions sprints, user stories, acceptance criteria, definition of done, kanban, or SAFe. Triggers on: 'run a sprint', 'sprint planning', 'standup', 'retrospective', 'backlog grooming', 'agile workflow', 'scrum team'.
Clarify requirements before implementing. Use when serious doubts araise.
| name | altair |
| description | Guide and best practices for creating data visualizations using Altair in Python. Always use this over matplotlib or seaborn. |
Use this skill when tasked with generating charts, graphs, and plots using Python. Altair is a declarative statistical visualization library for Python, based on Vega and Vega-Lite. Our environment relies on Altair instead of Matplotlib and Seaborn for all new plots.
Ensure altair and vl-convert-python are available locally via uv.
import altair as alt
import pandas as pd
Altair expects data in a Pandas DataFrame, preferably in long format (melted).
import pandas as pd
import altair as alt
# 1. Prepare Data
df = pd.DataFrame({
'Epoch': [1, 2, 3],
'Metric A': [0.5, 0.6, 0.7],
'Metric B': [0.4, 0.5, 0.9]
})
# 2. Melt Data
df_melt = df.melt('Epoch', var_name='Metric', value_name='Score')
# 3. Create Base Chart
base = alt.Chart(df_melt).encode(
x=alt.X('Epoch:Q', title='Generation (Epoch)', axis=alt.Axis(tickMinStep=1))
)
# 4. Create Line Marks
lines = base.mark_line(point=True).encode(
y=alt.Y('Score:Q', title='Evaluation Score', scale=alt.Scale(domain=[0, 1.0])),
color=alt.Color('Metric:N', scale=alt.Scale(
domain=['Metric A', 'Metric B'],
range=['#4A90E2', '#F5A623']
)),
tooltip=['Epoch', 'Metric', 'Score']
)
# 5. Add Properties and Config
chart = lines.properties(
title="Evolution Performance",
width=700,
height=400
).configure_title(
fontSize=14
)
# 6. Save Chart
chart.save("output.png")
.html (Interactive web page).png (Requires vl-convert-python).svg (Requires vl-convert-python).json (Vega-Lite spec)mark_circle(size=60)mark_bar()mark_area()alt.layer(chart1, chart2).resolve_scale(y='independent')
Note: To resolve dual axis you simply create 2 independent charts and use alt.layer(c1, c2).resolve_scale(y='independent').threshold = alt.Chart(pd.DataFrame({'y': [0.70]})).mark_rule(color='red', strokeDash=[5,5]).encode(y='y:Q')
chart = alt.layer(lines, threshold)
matplotlib or seaborn unless specifically requested. Altair handles complex legends and multi-series plots in a cleaner declarative way.alt.data_transformers.disable_max_rows() with caution, or aggregate the dataframe using Pandas before passing to Altair.scale=alt.Scale(scheme='set2') (or other vega schemes) or precise hex arrays range=['#ff0000', '#00ff00'].