Statistical charts in the browser

Run seaborn Online

Write seaborn code and see the chart right away, with nothing to install. seaborn, Matplotlib, pandas and NumPy are already in the online editor: import seaborn as sns and run. Each example below opens in the editor with one click.

What you can do

  • Distributionshistplot, kdeplot, ecdfplot and displot, split by a column with hue=.
  • Relationshipsscatterplot, lineplot, regplot and lmplot with fitted lines and confidence bands.
  • Categories and matricesboxplot, violinplot, barplot, heatmap, clustermap and pairplot.
  • Your own dataThe editor has no internet access, so sns.load_dataset cannot download sample data. Build a DataFrame in code, as the examples do, or upload a CSV to your workspace.

Histogram with a density curve

histplot draws one histogram per day with hue=, and kde=True adds a smooth density curve. sns.set_theme gives the whole chart seaborn's look.

histogram.py
Run this chart →
histogram.py
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns

rng = np.random.default_rng(1)
df = pd.DataFrame({
    "day": np.repeat(["Thu", "Fri", "Sat", "Sun"], 50),
    "bill": np.concatenate([rng.normal(m, 6, 50) for m in (17, 18, 21, 22)]).round(2),
})

sns.set_theme(style="whitegrid")
sns.histplot(data=df, x="bill", hue="day", kde=True, element="step")
plt.title("Bill amount by day")
plt.show()

Scatter plot with regression lines

lmplot fits a regression line for each group and shades its confidence interval. It returns a FacetGrid, so plt.title and plt.show still work.

regression.py
Run this chart →
regression.py
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns

rng = np.random.default_rng(2)
df = pd.DataFrame({"hours": rng.uniform(0, 10, 150), "group": rng.choice(["online", "in person"], 150)})
df["score"] = 50 + 4 * df["hours"] + np.where(df["group"] == "online", -3, 3) + rng.normal(0, 5, 150)

sns.set_theme(style="ticks")
sns.lmplot(data=df, x="hours", y="score", hue="group", height=4, aspect=1.4)
plt.title("Study hours vs score")
plt.show()

Correlation heatmap

df.corr() gives the correlation matrix and heatmap colors it, with annot=True writing each value in its cell.

heatmap.py
Run this chart →
heatmap.py
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns

rng = np.random.default_rng(3)
df = pd.DataFrame(rng.normal(size=(200, 4)), columns=["price", "rating", "reviews", "returns"])
df["reviews"] += df["rating"] * 0.8
df["returns"] -= df["rating"] * 0.6

sns.heatmap(df.corr(), annot=True, fmt=".2f", cmap="coolwarm", vmin=-1, vmax=1, square=True)
plt.title("Correlation matrix")
plt.tight_layout()
plt.show()

Frequently asked questions

Can I use seaborn online without installing it?

Yes. seaborn is installed in the online Matplotlib editor along with Matplotlib, pandas and NumPy. Write import seaborn as sns, run the code, and the chart appears.

Why does sns.load_dataset not work?

load_dataset downloads sample data from the internet, and the editor runs code without internet access. Build a DataFrame in your code or upload a CSV file to your workspace and read it with pandas.

How do I show a seaborn chart?

Call plt.show() after the seaborn function, as in Matplotlib. Charts still open at the end of the program are shown too.

Which seaborn version is it?

seaborn 0.13, with Matplotlib, pandas 2 and NumPy 2.

Can I save the chart?

Yes. Download it from the chart window, or call plt.savefig("chart.png") to save it in your workspace.