Typing Stubs for Seaborn

0.13.2.20260408 · active · verified Mon Apr 13

types-seaborn is a type stub package providing static type annotations for the popular Seaborn statistical data visualization library. It allows type checkers (like MyPy or Pyright) to verify code that uses Seaborn, improving code quality and catching potential errors during development. This package is part of the broader typeshed project, and its current version, 0.13.2.20260408, aims to provide accurate annotations for seaborn==0.13.2.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates a typical use of Seaborn to create a statistical visualization. It imports Seaborn (aliased as `sns`), Matplotlib for displaying the plot, and Pandas for data handling. It then loads a sample dataset, applies a default Seaborn theme, creates a complex relational plot, and finally displays it.

import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd # Often used with seaborn

# Apply the default seaborn theme for aesthetics
sns.set_theme()

# Load an example dataset provided by seaborn
tips = sns.load_dataset("tips")

# Create a relational plot
sns.relplot(
    data=tips, 
    x="total_bill", 
    y="tip", 
    col="time", 
    hue="smoker", 
    style="smoker", 
    size="size"
)

plt.title("Tips by Total Bill, Time, and Smoker Status")
plt.show()

view raw JSON →