Beautiful plots with Seaborn

Udbhav Pangotra
Geek Culture
Published in
3 min readJan 24, 2022

Create Plots that get your visualization journey started!

Photo by Bench Accounting on Unsplash

Data visualization techniques allow data scientists to convert raw data into charts and plots that generate valuable insights, reducing the complexity of the data and make it easier to understand for the end user.

Seaborn is a library for making statistical graphics in Python. It builds on top of matplotlib and integrates closely with pandas data structures. Seaborn design allows you to explore and understand your data quickly.

pipenv install seaborn notebook

Additionally, we are going to import a few modules before we get started.

Scatter Plot

A scatter plot is a diagram that displays points based on two dimensions of the dataset. Creating a scatter plot in the seaborn library is so simple and with just one line of code.

Scatter Plot
sns.scatterplot(data=flights_data, x="year", y="passengers")
Bar Plot

Bar Plot

It is probably the best-known type of chart, and as you may have predicted, we can plot this type of plot with seaborn in the same way we do for lines and scatter plots by using the function barplot.

sns.barplot(data=flights_data, x="year", y="passengers")

Making beautiful plots with styles

Seaborn gives you the ability to change your graphs’ interface, and it provides five different styles out of the box: darkgrid, whitegrid, dark, white, and ticks.

Line plot
sns.set_style("darkgrid")
sns.lineplot(data = data, x = "year", y = "passengers")

Heatmap chart

Heat Map
pivot = tips_df.pivot_table(
index=["day"],
columns=["size"],
values="tip_percentage",
aggfunc=np.average)
sns.heatmap(pivot)

Do reach out and comment if you get stuck!

Other articles that might be interested in:

Cheers and do follow for more such content! :)

You can now buy me a coffee too if you liked the content!
samunderscore12 is creating data science content! (buymeacoffee.com)

--

--