Seaborn
Seaborn
Seaborn is also closely integrated with the Panda's data structures, and with
this, we can easily jump between the various different visual representations for
a given variable to better understand the provided dataset.
1. Line plot:
The seaborn line plot is one of the most basic plots presents in the seaborn
library. We use the seaborn line plot mainly to visualize the given data in some
time-series form, i.e., in a continuous manner with respect to time.
sns.set(style="dark")
FMR = sns.load_dataset("fmri")
sns.lineplot(x="timepoint",
y="signal",
hue="region",
style="event",
Output:
2. Dist plot:
We use the seaborn dist plots to plot histograms with the given variables and
data as a result. We can plot histograms with some other variations such as
rugplot and kdeplot using a dist plot.
Example -
3. Lmplot:
The Lmplot is another one of the basic plots in the seaborn library. The Lmplot
shows a line that represents a linear regression model with the data points on
the given two-dimensional (2-D) space. In this 2-D space, we can set x and y
variables as the vertical and horizontal labels, respectively.
Example:
# Importing seaborn library in program
import seaborn as sns
# Importing matplotlib library to show graph in output
import matplotlib.pyplot as plt
# Using set() function to set style
sns.set(style="ticks")
# Using dataset() function
ds = sns.load_dataset("anscombe")
# Showing results in the form of linear regression
sns.lmplot(x="x", y="y", data=ds)