Software Tech

Seaborn-High Level Graphical Representation

Data visualization library based on Matplotlib. Provides High Level Graphical interface. import seaborn as sns import matplotlib.pyplot as plt

Seaborn-High Level Graphical Representation

Data library based on . Provides High Level Graphical .

import seaborn as sns
import matplotlib.pyplot as plt

loading dataset,# draw lineplot,# setting the limit of the # # changing the theme to dark

data = sns.load_dataset(“iris”)
sns.lineplot(x=”sepal_length”, y=”sepal_width”, data=data)
plt.xlim(5)
sns.set_style(“dark”)
plt.show()

figure() method.

data = sns.load_dataset(“iris”)
plt.figure(figsize = (4, 4))
sns.lineplot(x=”sepal_length”, y=”sepal_width”, data=data)
sns.despine()
plt.show()

set_context() method

Syntax:

set_context(context=None, font_scale=1, rc=None)

data = sns.load_dataset(“iris”)
sns.lineplot(x=”sepal_length”, y=”sepal_width”, data=data)
sns.set_context(“poster”)
plt.show()

*Subplot Already Discued in Matplotlib

Relational Plots–>Relational plots are used for visualizing the statistical relationship between the data points

Syntax:

seaborn.relplot(x=None, y=None, data=None, **kwargs)

data = sns.load_dataset(“iris”)
sns.relplot(x='sepal_width', y='species', data=data)

plt.show()

Scatter

Syntax:

seaborn.scatterplot(x=None, y=None, data=None, **kwargs)

data = sns.load_dataset(“iris”)
sns.scatterplot(x='sepal_length', y='sepal_width', data=data)
plt.show()

Plot

Syntax:

seaborn.lineplot(x=None, y=None, data=None, **kwargs)

data = sns.load_dataset(“iris”)
sns.lineplot(x='sepal_length', y='species', data=data)
plt.show()

Bar Plot

Syntax:

barplot([x, y, , data, order, hue_order, …])

data = sns.load_dataset(“iris”)
sns.barplot(x='species', y='sepal_length', data=data)
plt.show()

Count Plot

Syntax:

countplot([x, y, hue, data, order, …])

data = sns.load_dataset(“iris”)

sns.countplot(x='species', data=data)
plt.show()

Box Plot

Syntax:

# boxplot([x, y, hue, data, order, hue_order, …])

data = sns.load_dataset(“iris”)

sns.boxplot(x='species', y='sepal_width', data=data)
plt.show()

Violinplot

Syntax:

violinplot([x, y, hue, data, order, …]

data = sns.load_dataset(“iris”)

sns.violinplot(x='species', y='sepal_width', data=data)
plt.show()

Stripplot

Syntax:

stripplot([x, y, hue, data, order, …])

data = sns.load_dataset(“iris”)

sns.stripplot(x='species', y='sepal_width', data=data)
plt.show()

Swarmplot

Syntax:

swarmplot([x, y, hue, data, order, …])

data = sns.load_dataset(“iris”)

sns.swarmplot(x='species', y='sepal_width', data=data)
plt.show()


Syntax:

histplot(data=None, *, x=None, y=None, hue=None, **kwargs)

data = sns.load_dataset(“iris”)

sns.histplot(x='species', y='sepal_width', data=data)
plt.show()

Distplot

Syntax:

distplot(a[, bins, hist, kde, rug, fit, …])

data = sns.load_dataset(“iris”)

sns.distplot(data[‘sepal_width'])
plt.show()

Jointplot

Syntax:

jointplot(x, y[, data, kind, stat_func, …])

data = sns.load_dataset(“iris”)
sns.jointplot(x='species', y='sepal_width', data=data)
plt.show()

Pairplot

Syntax:

pairplot(data[, hue, hue_order, , …])

data = sns.load_dataset(“iris”)
sns.pairplot(data=data, hue='species')
plt.show()

Rugplot

Syntax:

rugplot(a[, height, axis, ])

data = sns.load_dataset(“iris”)
sns.rugplot(data=data)
plt.show()

KDE Plot

Syntax:

seaborn.kdeplot(x=None, *, y=None, vertical=False, palette=None, **kwargs)

data = sns.load_dataset(“iris”)
sns.kdeplot(x='sepal_length', y='sepal_width', data=data)
plt.show()

Regression Plots

Syntax:

seaborn.lmplot(x, y, data, hue=None, col=None, row=None, **kwargs)

data = sns.load_dataset(“tips”)
sns.lmplot(x='total_bill', y='', data=data)
plt.show()

Regplot

Syntax:

seaborn.regplot( x, y, data=None, x_estimator=None, **kwargs)

data = sns.load_dataset(“tips”)
sns.regplot(x='total_bill', y='tip', data=data)
plt.show()

Heatmap

Syntax:

seaborn.heatmap(data, *, vmin=None, vmax=None, cmap=None, center=None, annot_kws=None, linewidths=0, linecolor='white', cbar=True, **kwargs)

data = sns.load_dataset(“tips”)
# correlation between the different parameters
tc = data.corr()
sns.heatmap(tc)
plt.show()
About Author

muradalhasan

Leave a Reply

SOFAIO BLOG We would like to show you notifications for the latest news and updates.
Dismiss
Allow Notifications