{"id":704,"library":"seaborn","title":"Seaborn","description":"Seaborn is a high-level Python library for creating statistical graphics, building on Matplotlib and integrating closely with Pandas data structures. It provides a dataset-oriented API to draw attractive and informative statistical plots with ease. The library is actively maintained with regular minor and major releases, currently at version 0.13.2, ensuring compatibility with evolving data science ecosystems.","status":"active","version":"0.13.2","language":"python","source_language":"en","source_url":"https://github.com/mwaskom/seaborn","tags":["data visualization","plotting","statistics","data science","matplotlib","pandas"],"install":[{"cmd":"pip install seaborn","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Mandatory dependency for numerical operations.","package":"numpy","optional":false},{"reason":"Mandatory dependency, closely integrated for data structures (DataFrames).","package":"pandas","optional":false},{"reason":"Mandatory dependency, Seaborn builds on top of Matplotlib for plotting.","package":"matplotlib","optional":false},{"reason":"Required for some advanced statistical functionality.","package":"scipy","optional":true},{"reason":"Required for some advanced statistical functionality, particularly regression plots.","package":"statsmodels","optional":true}],"imports":[{"note":"The standard and widely adopted alias for Seaborn.","symbol":"seaborn","correct":"import seaborn as sns"},{"note":"Recommended alias for the experimental declarative 'objects' interface introduced in v0.12.0.","symbol":"seaborn.objects","correct":"import seaborn.objects as so"}],"quickstart":{"code":"import seaborn as sns\nimport matplotlib.pyplot as plt\n\nsns.set_theme(style=\"darkgrid\")\n\n# Load an example dataset\ntips = sns.load_dataset(\"tips\")\n\n# Create a scatter plot\nsns.scatterplot(\n    data=tips, \n    x=\"total_bill\", \n    y=\"tip\", \n    hue=\"smoker\", \n    style=\"time\", \n    size=\"size\"\n)\n\nplt.title(\"Total Bill vs. Tip by Smoker and Time\")\nplt.xlabel(\"Total Bill ($)\")\nplt.ylabel(\"Tip ($)\")\nplt.show()","lang":"python","description":"This quickstart demonstrates loading a built-in dataset, applying a theme, and creating a relational scatter plot using Seaborn's high-level API. It also includes basic Matplotlib calls for customization and displaying the plot."},"warnings":[{"fix":"Consult the official `seaborn.objects` documentation for specific usage and known limitations. For simpler plots or existing code, continue using the traditional axes-level and figure-level functions.","message":"The `seaborn.objects` interface was introduced in v0.12.0, offering a new declarative API. While powerful, it's considered experimental and may have breaking changes or rough edges in early minor releases.","severity":"breaking","affected_versions":">=0.12.0"},{"fix":"Review code using categorical plots. To reproduce previous color behavior, explicitly assign a redundant `hue` variable (e.g., `boxplot(data, x='x', y='y', hue='x')`). If mixing categorical and numerical data on an axis, consider `native_scale=True`.","message":"Seaborn's categorical plotting functions (e.g., `boxplot`, `barplot`, `catplot`) underwent a major overhaul in v0.13.0. This includes changes to color defaults (now requiring explicit `hue` for multiple colors) and the introduction of the `native_scale` parameter.","severity":"breaking","affected_versions":">=0.13.0"},{"fix":"Upgrade to Python 3.8 or newer to ensure compatibility and receive future updates.","message":"Python 3.7 support was dropped in Seaborn v0.12.2.","severity":"deprecated","affected_versions":">=0.12.2"},{"fix":"Always pass arguments like `x`, `y`, `data` using explicit keywords (e.g., `sns.scatterplot(data=df, x='col1', y='col2')` instead of `sns.scatterplot(df, 'col1', 'col2')`).","message":"Positional arguments for most plotting functions were deprecated in v0.11.0 and enforced to be keyword-only in v0.12.0. This applies to arguments like `x`, `y`, `hue`, etc.","severity":"gotcha","affected_versions":">=0.12.0"},{"fix":"Update to Seaborn v0.13.1 or later. Ensure that data passed to Seaborn plotting functions are of appropriate (usually numerical) NumPy types, converting Pandas nullable dtypes explicitly if necessary (e.g., `.astype(float)`).","message":"A regression in v0.13.0 caused exceptions when working with non-NumPy data types (e.g., Pandas nullable dtypes), which was fixed in v0.13.1. Pandas dtypes can still sometimes cause issues as Matplotlib (and by extension, Seaborn) often expects NumPy dtypes.","severity":"gotcha","affected_versions":"0.13.0"},{"fix":"For Seaborn v0.13.0+, use `native_scale=True` in categorical plots if the categorical axis truly represents numeric or datetime data. For older versions or string categories, carefully manage axis limits and tick labels using Matplotlib to ensure alignment.","message":"When combining categorical plots with other plot types (e.g., a bar plot and a line plot on the same axes), misalignment can occur because categorical plots internally map string/category values to integer indices.","severity":"gotcha","affected_versions":"all"},{"fix":"It is generally recommended to run `pip` in a virtual environment to avoid permission issues and system conflicts. To update `pip`, run `pip install --upgrade pip`. If running as root is intentional and understood, use `pip --root-user-action=ignore` to suppress the warning.","message":"The test environment generated warnings or notices from `pip` related to running as the root user or an available update for `pip`. These are typically environment-specific messages from the package manager, not direct failures of the tested library.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-12T18:00:02.230Z","next_check":"2026-06-26T00:00:00.000Z","problems":[{"fix":"Call `sns.distplot()` directly, passing the `ax` parameter if you want to draw on a specific axes, or use the recommended `sns.histplot` or `sns.kdeplot` which support the `ax` parameter directly.","cause":"The `distplot` function (or its replacements like `histplot` and `kdeplot`) is a top-level function in the `seaborn` module, not a method directly callable on a Matplotlib Axes object.","error":"AttributeError: 'AxesSubplot' object has no attribute 'distplot'"},{"fix":"Handle `NaN` values by either filling them (e.g., `df.fillna(0)`) or using a float format string (e.g., `fmt='.1f'` or `fmt='g'`) with `annot=True`, or set `annot=False` if annotations are not strictly needed.","cause":"This error commonly occurs in `seaborn.heatmap` when `annot=True` is used with a format string for integers (e.g., `fmt='d'`) while the underlying data contains `NaN` (Not a Number) values, which are floats and cannot be directly converted to integers.","error":"ValueError: cannot convert float NaN to integer"},{"fix":"Replace `shade=True` with `fill=True` when calling `sns.kdeplot`.","cause":"The `shade` parameter in `seaborn.kdeplot` was deprecated and subsequently removed in Seaborn versions 0.11.0 and later, replaced by the `fill` parameter.","error":"TypeError: kdeplot got an unexpected keyword argument 'shade'"},{"fix":"Use the `g.fig.suptitle()` method for an overall figure title, or `g.set_titles()` to set titles for individual subplots within the `FacetGrid`.","cause":"Figure-level functions in Seaborn (like `sns.relplot`, `sns.catplot`, `sns.displot`, `sns.FacetGrid`) return a `FacetGrid` object, which is not a Matplotlib Axes object and thus does not have a `set_title` method; titles need to be set differently for figure-level plots.","error":"AttributeError: 'FacetGrid' object has no attribute 'set_title'"}],"ecosystem":"pypi","meta_description":null,"install_score":95,"install_tag":"verified","quickstart_score":80,"quickstart_tag":"verified","pypi_latest":"0.13.2","install_checks":{"last_tested":"2026-05-12","tag":"verified","tag_description":"installs cleanly on critical runtimes, fast import, recently tested","results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":null,"import_time_s":3.53,"mem_mb":57.1,"disk_size":"253.9M"},{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":3.48,"mem_mb":57.1,"disk_size":"253.6M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":11.4,"import_time_s":2.72,"mem_mb":57.2,"disk_size":"243M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":2.55,"mem_mb":57.1,"disk_size":"242M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":null,"import_time_s":4.26,"mem_mb":63.9,"disk_size":"274.7M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":4.73,"mem_mb":63.7,"disk_size":"274.3M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":11,"import_time_s":4.14,"mem_mb":63.9,"disk_size":"262M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":3.69,"mem_mb":63.7,"disk_size":"262M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":null,"import_time_s":3.66,"mem_mb":62.6,"disk_size":"258.4M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":3.93,"mem_mb":62.5,"disk_size":"258.0M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":10.9,"import_time_s":4.01,"mem_mb":62.6,"disk_size":"245M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":4.33,"mem_mb":62.5,"disk_size":"245M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":null,"import_time_s":3.37,"mem_mb":62.4,"disk_size":"257.2M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":3.63,"mem_mb":62.3,"disk_size":"256.7M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":11,"import_time_s":3.56,"mem_mb":62.4,"disk_size":"244M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":3.72,"mem_mb":62.3,"disk_size":"243M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":null,"import_time_s":3.37,"mem_mb":57.2,"disk_size":"257.8M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":3.34,"mem_mb":57,"disk_size":"257.6M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":13.6,"import_time_s":3.08,"mem_mb":57.2,"disk_size":"249M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":2.97,"mem_mb":57.1,"disk_size":"249M"}]},"quickstart_checks":{"last_tested":"2026-04-24","tag":"verified","tag_description":"quickstart runs on critical runtimes, recently tested","results":[{"runtime":"python:3.10-alpine","exit_code":0},{"runtime":"python:3.10-slim","exit_code":0},{"runtime":"python:3.11-alpine","exit_code":0},{"runtime":"python:3.11-slim","exit_code":0},{"runtime":"python:3.12-alpine","exit_code":0},{"runtime":"python:3.12-slim","exit_code":0},{"runtime":"python:3.13-alpine","exit_code":0},{"runtime":"python:3.13-slim","exit_code":0},{"runtime":"python:3.9-alpine","exit_code":0},{"runtime":"python:3.9-slim","exit_code":0}]}}