seaborn
Fungsinya
Skill ini mengajari agent cara membuat grafik statistik dengan pustaka seaborn di Python. Cocok untuk eksplorasi data dengan cepat, misalnya melihat sebaran nilai atau hubungan dua variabel.
Kapan dipakai
- ✓Saat pengguna ingin melihat sebaran nilai antar kelompok dengan box atau violin plot.
- ✓Saat pengguna ingin menjelajahi hubungan beberapa variabel dengan pair plot.
- ✓Saat pengguna punya tabel data dan ingin heatmap atau grafik perbandingan cepat.
Link skill
https://github.com/zLanqing/codex-claude-academic-skills/blob/main/scientific-toolkit-skill/references/scientific-skills/seaborn/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
“Tampilkan box plot yang membandingkan nilai ujian saya di tiga kelas dari tabel data ini.”
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agent memuat data ke dalam tabel, memilih jenis plot seaborn yang sesuai, lalu menggambarnya dengan gaya bawaan seaborn. Matplotlib bisa dipakai untuk perubahan yang lebih rinci.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Seaborn Statistical Visualization
Overview
Seaborn is a Python visualization library for creating publication-quality statistical graphics. Use this skill for dataset-oriented plotting, multivariate analysis, automatic statistical estimation, and complex multi-panel figures with minimal code.
Design Philosophy
Seaborn follows these core principles:
- Dataset-oriented: Work directly with DataFrames and named variables rather than abstract coordinates
- Semantic mapping: Automatically translate data values into visual properties (colors, sizes, styles)
- Statistical awareness: Built-in aggregation, error estimation, and confidence intervals
- Aesthetic defaults: Publication-ready themes and color palettes out of the box
- Matplotlib integration: Full compatibility with matplotlib customization when needed
Quick Start
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
# Load example dataset
df = sns.load_dataset('tips')
# Create a simple visualization
sns.scatterplot(data=df, x='total_bill', y='tip', hue='day')
plt.show()
Core Plotting Interfaces
Function Interface (Traditional)
The function interface provides specialized plotting functions organized by visualization type. Each category has axes-level functions (plot to single axes) and figure-level functions (manage entire figure with faceting).
When to use:
- Quick exploratory analysis
- Single-purpose visualizations
- When you need a specific plot type
Objects Interface (Modern)
The seaborn.objects interface provides a declarative, composable API similar to ggplot2. Build visualizations by chaining methods to specify data mappings, marks, transformations, and scales.
When to use:
- Complex layered visualizations
- When you need fine-grained control over transformations
- Building custom plot types
- Programmatic plot generation
from seaborn import objects as so
# Declarative syntax
(
so.Plot(data=df, x='total_bill', y='tip')
.add(so.Dot(), color='day')
.add(so.Line(), so.PolyFit())
)
Plotting Functions by Category
Relational Plots (Relationships Between Variables)
Use for: Exploring how two or more variables relate to each other
scatterplot()- Display individual observations as pointslineplot()- Show trends and changes (automatically aggregates and computes CI)relplot()- Figure-level interface with automatic faceting
Key parameters:
x,y- Primary variableshue- Color encoding for additional categorical/continuous variablesize- Point/line size encodingstyle- Marker/line style encodingcol,row- Facet into multiple subplots (figure-level only)
# Scatter with multiple semantic mappings
sns.scatterplot(data=df, x='total_bill', y='tip',
hue='time', size='size', style='sex')
# Line plot with confidence intervals
sns.lineplot(data=timeseries, x='date', y='value', hue='category')
# Faceted relational plot
sns.relplot(data=df, x='total_bill', y='tip',
col='time', row='sex', hue='smoker', kind='scatter')
Distribution Plots (Single and Bivariate Distributions)
Use for: Understanding data spread, shape, and probability density
histplot()- Bar-based frequency distributions with flexible binningkdeplot()- Smooth density estimates using Gaussian kernelsecdfplot()- Empirical cumulative distribution (no parameters to tune)rugplot()- Individual observation tick marksdisplot()- Figure-level interface for univariate and bivariate distributionsjointplot()- Bivariate plot with marginal distributionspairplot()- Matrix of pairwise relationships across dataset
Key parameters:
x,y- Variables (y optional for univariate)hue- Separate distributions by categorystat- Normalization: "count", "frequency", "probability", "density"bins/binwidth- Histogram binning controlbw_adjust- KDE bandwidth multiplier (higher = smoother)fill- Fill area under curvemultiple- How to handle hue: "layer", "stack", "dodge", "fill"
# Histogram with density normalization
sns.histplot(data=df, x='total_bill', hue='time',
stat='density', multiple='stack')
# Bivariate KDE with contours
sns.kdeplot(data=df, x='total_bill', y='tip',
fill=True, levels=5, thresh=0.1)
# Joint plot with marginals
sns.jointplot(data=df, x='total_bill', y
Pertanyaan umum
Apakah seaborn menghitung statistik sendiri?
Ya. Skill ini menyebutkan seaborn menyertakan agregasi dan interval kepercayaan bawaan.
Kapan saya sebaiknya memakai alat lain?
Skill ini menyarankan plotly untuk grafik interaktif dan skill visualisasi ilmiah untuk gaya publikasi.
Apakah seaborn dibangun di atas matplotlib?
Ya. Skill ini menyebutkan seaborn dibangun di atas matplotlib dan bisa dikustomisasi dengannya.
Detail
Deskripsi asli dari pembuat
Statistical visualization with pandas integration. Use for quick exploration of distributions, relationships, and categorical comparisons with attractive defaults. Best for box plots, violin plots, pair plots, heatmaps. Built on matplotlib. For interactive plots use plotly; for publication styling use scientific-visualization.
Popularitas
- Bintang GitHub
- 5.6k
- Peringkat
- #14772
- Lisensi
- MIT
- Diperbarui
- 14/5/2026
Komentar
- …
Skill lain dari repositori ini
office-academic-skill
5.6kMembantu agent Anda mengubah makalah riset menjadi laporan Word dan slide PowerPoint akademik yang bisa diedit, berbahasa Mandarin, dengan catatan pembicara.
research-writing-skill
5.6kMembantu agent Anda menulis dan merevisi bagian makalah riset, abstrak, serta tanggapan reviewer, dengan rumus, judul, dan sitasi dijaga apa adanya.
scientific-toolkit-skill
5.6kMembantu agent Anda menulis dan memperbaiki kode ilmiah MATLAB atau Python untuk pemrosesan sinyal dan citra, statistik, simulasi, dan gambar siap publikasi.
matlab
5.6kMembantu agent Anda menulis dan memperbaiki skrip MATLAB dan GNU Octave untuk aljabar matriks, sinyal, citra, persamaan diferensial, dan grafik.
Skill serupa
gitcrawl
394kMemungkinkan agent Anda mencari arsip issue dan pull request GitHub yang tersimpan, mengelompokkan yang duplikat, dan memeriksa status terkininya di GitHub.
slacrawl
394kMemungkinkan agent Anda mencari dan menghitung pesan di arsip Slack lokal, memeriksa seberapa baru arsip itu, dan menyegarkannya bila diperlukan.
goplaces
394kMembantu agent Anda mencari tempat, mendapatkan detail dan ulasannya, serta menentukan nama tempat memakai Google Places, dengan keluaran JSON untuk skrip.