seaborn
고수준 코드High-level codematplotlib 위에서 pandas 데이터로 통계 차트를 한 줄로 그려 주는 Python 라이브러리입니다.A Python library built on matplotlib that draws statistical charts from pandas data in a single line of code.
현재 버전Current version: 0.13.2, 정보 확인일 2026-10-24facts checked 2026-10-24
개요Overview
seaborn은 matplotlib 위에 만들어진 Python 통계 시각화 라이브러리입니다. pandas DataFrame의 열 이름을 x, y, hue 같은 인자에 그대로 넘기면 집계, 신뢰구간 계산, 색 지정, 범례까지 알아서 처리한 차트를 그려 줍니다. 분포, 관계, 범주별 비교를 보는 탐색적 데이터 분석에서 가장 먼저 쓰이는 도구 가운데 하나입니다.
seaborn is a Python statistical visualization library built on top of matplotlib. You pass pandas DataFrame column names to arguments such as x, y and hue, and it handles aggregation, confidence intervals, color mapping and legends for you. It is one of the first tools people reach for in exploratory data analysis of distributions, relationships and group comparisons.
결과는 matplotlib 객체이므로 plt.title, ax.set_xlabel, savefig 같은 matplotlib 기능으로 계속 다듬을 수 있습니다. 작은 창 여러 개로 나누는 facet 차트(relplot, displot, catplot)와 변수 쌍을 한꺼번에 보는 pairplot이 특징입니다.
The result is a matplotlib object, so you can keep refining it with matplotlib features such as plt.title, ax.set_xlabel and savefig. Facet charts that split the data into small panels (relplot, displot, catplot) and pairplot, which shows many variable pairs at once, are its signature features.
최신 릴리스는 0.13.2(2024년 1월 25일)입니다. 그 뒤로 PyPI 릴리스는 없지만 저장소는 2026년 10월에도 활발히 갱신되고 있고, 아카이브되지 않았습니다. 대화형 차트를 만들지는 않으므로 웹에서 호버나 확대가 필요하면 Plotly나 Altair를 쓰십시오.
The latest release is 0.13.2 (January 25, 2024). There has been no PyPI release since, but the repository is still actively updated as of October 2026 and is not archived. It does not make interactive charts, so use Plotly or Altair when you need hover and zoom on the web.
2026년 현재What's new in 2026
- 최신 버전은 0.13.2(2024년 1월)이며 2026년 10월 현재 그 이후 릴리스가 없습니다. 문서도 0.13.2 기준입니다.
- The latest version is 0.13.2 (January 2024), and no newer release exists as of October 2026. The documentation also targets 0.13.2.
- 저장소는 2026년 10월에도 갱신되어 유지보수가 계속되는 것으로 보이지만, 새 기능은 릴리스 전까지 pip로 받을 수 없습니다.
- The repository was still updated in October 2026, so maintenance appears to continue, but new features cannot be installed with pip until a release.
- seaborn.objects 인터페이스는 0.12.0에서 도입되었고 0.13.0에서 설정 방식이 개선되었습니다. 문법을 쌓아 가는 grammar of graphics 스타일이며, 입문 단계에서는 기존 함수형 API를 먼저 배우는 편이 안전합니다.
- The seaborn.objects interface was introduced in 0.12.0 and its configuration was improved in 0.13.0. It builds charts in a grammar-of-graphics style, and the classic function API is the safer starting point for beginners.
- seaborn 자체에 AI 기능은 없습니다. AI 어시스턴트가 분석 코드를 쓸 때 가장 자주 선택하는 라이브러리 중 하나이므로, 코드가 어떤 집계와 신뢰구간을 쓰는지 읽어 보는 습관이 필요합니다.
- seaborn itself has no AI features. AI assistants often choose it when writing analysis code, so get into the habit of reading which aggregation and confidence intervals the code uses.
강점Strengths
- 한 줄로 통계적으로 의미 있는 차트를 그립니다. 분포, 회귀선, 신뢰구간이 기본 제공됩니다.
- One line produces a statistically meaningful chart, with distributions, regression lines and confidence intervals built in.
- pandas의 long-form 데이터와 열 이름을 그대로 쓰므로 데이터 정리와 시각화가 자연스럽게 이어집니다.
- It works directly with long-form pandas data and column names, so data preparation flows into plotting.
- facet 차트로 범주별 작은 창 비교를 쉽게 만들 수 있습니다.
- Facet charts make small-panel comparisons across categories easy.
- 기본 테마와 색 팔레트가 읽기 좋게 설계되어 있어 보고서에 바로 쓸 만한 그림이 나옵니다.
- The default themes and color palettes are designed for readability, so figures are close to report-ready.
- matplotlib 객체를 돌려주므로 세부 조정과 PNG, PDF, SVG 저장이 자유롭습니다.
- It returns matplotlib objects, so fine adjustments and saving to PNG, PDF or SVG are straightforward.
- 히트맵, 클러스터 히트맵, pairplot 등 탐색용 차트가 풍부합니다.
- It offers many exploratory charts such as heatmaps, clustered heatmaps and pairplots.
한계Limitations
- 정적 이미지 중심입니다. 호버, 확대, 필터 같은 상호작용은 기본으로 없습니다.
- Output is mostly static images; hover, zoom and filtering are not built in.
- 지도, 네트워크, 샌키 같은 차트 유형은 지원하지 않습니다.
- Chart types such as maps, networks and Sankey diagrams are not supported.
- 정리된 long-form 또는 wide-form 데이터가 필요합니다. 데이터 모양이 맞지 않으면 pandas로 먼저 바꿔야 합니다.
- It expects tidy long-form or wide-form data, so reshape with pandas first if the data is in another form.
- 집계와 신뢰구간이 자동으로 들어가므로 기본값이 무엇인지 모르면 그림을 잘못 해석할 수 있습니다.
- Aggregation and confidence intervals are added automatically, so you can misread a figure if you do not know the defaults.
- 세밀한 배치와 주석은 결국 matplotlib 지식이 필요합니다.
- Fine layout and annotation eventually require matplotlib knowledge.
- 릴리스 간격이 길어 새 기능이 느리게 반영됩니다.
- Releases are far apart, so new features arrive slowly.
이런 용도에 최적Best For
데이터를 처음 훑어보는 탐색 단계, 논문과 보고서용 정적 통계 그림, 수업 실습에 적합합니다. 변수 사이의 관계, 그룹별 분포, 상관관계를 빠르게 확인하고 싶은 학생과 연구자가 주 사용자입니다.
It suits the first pass over a dataset, static statistical figures for papers and reports, and classroom exercises. Its main users are students and researchers who want to check relationships between variables, group distributions and correlations quickly.
웹에 게시할 대화형 차트나 대시보드가 목적이라면 Plotly, Altair, Streamlit 같은 도구가 더 맞습니다. 막대 하나 선 하나를 정밀하게 디자인하는 편집용 그래픽에는 matplotlib을 직접 쓰는 편이 낫습니다.
For interactive web charts or dashboards, tools such as Plotly, Altair and Streamlit fit better. For editorial graphics where every bar and line is designed precisely, using matplotlib directly is the better choice.
시작하기Getting Started
pip install seaborn으로 설치합니다. pandas와 matplotlib도 함께 설치됩니다.- Install with
pip install seaborn. pandas and matplotlib are installed with it. - Jupyter 노트북이나 Python 스크립트에서 seaborn을 불러오고 테마를 지정합니다.
- Import seaborn in a Jupyter notebook or Python script and set a theme.
- 내장 예제 데이터(
load_dataset)나 자신의 DataFrame을data=에 넘기고 열 이름으로 x, y, hue를 지정합니다.load_dataset은 인터넷에서 예제 파일을 내려받습니다. - Pass a built-in example dataset (
load_dataset) or your own DataFrame todata=and name the columns for x, y and hue.load_datasetdownloads the example file from the internet. - 결과를 확인할 때는 축의 시작값, 집계 방식, 오차 막대가 무엇을 뜻하는지 점검합니다. AI 어시스턴트에게 코드를 요청했다면 estimator와 errorbar 인자를 설명해 달라고 물어보십시오.
- When checking the result, look at the axis baselines, the aggregation, and what the error bars mean. If an AI assistant wrote the code, ask it to explain the estimator and errorbar arguments.
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_theme(style="whitegrid")
tips = sns.load_dataset("tips")
# Scatterplot split into one panel per meal time, colored by day
g = sns.relplot(
data=tips, x="total_bill", y="tip",
hue="day", col="time", kind="scatter",
)
g.set_axis_labels("Total bill ($)", "Tip ($)")
g.savefig("tips_scatter.png", dpi=200)
# Distribution of the bill by day, split by sex
fig, ax = plt.subplots(figsize=(7, 4))
sns.boxplot(data=tips, x="day", y="total_bill", hue="sex", ax=ax)
fig.savefig("tips_box.png", dpi=200)
# Correlation heatmap of the numeric columns
fig, ax = plt.subplots(figsize=(5, 4))
sns.heatmap(tips.corr(numeric_only=True), annot=True, vmin=-1, vmax=1, cmap="vlag", ax=ax)
fig.savefig("tips_corr.png", dpi=200)
지원 차트 유형Supported Chart Types
관계를 보는 함수로 scatterplot, lineplot, relplot이 있고, 분포를 보는 함수로 histplot, kdeplot, ecdfplot, rugplot, displot이 있습니다. 범주별 비교에는 stripplot, swarmplot, boxplot, violinplot, boxenplot, pointplot, barplot, countplot, catplot을 씁니다.
For relationships there are scatterplot, lineplot and relplot, and for distributions there are histplot, kdeplot, ecdfplot, rugplot and displot. For comparisons across categories use stripplot, swarmplot, boxplot, violinplot, boxenplot, pointplot, barplot, countplot and catplot.
회귀선은 regplot과 lmplot, 행렬 데이터는 heatmap과 clustermap, 여러 변수의 쌍별 관계는 pairplot과 jointplot으로 그립니다. 릿지라인 플롯 같은 겹친 분포는 FacetGrid와 kdeplot을 조합해 만들 수 있습니다.
Regression lines come from regplot and lmplot, matrix data from heatmap and clustermap, and pairwise relationships between many variables from pairplot and jointplot. Stacked distributions such as ridgeline plots can be built by combining FacetGrid and kdeplot.