Course Content
First Dive into seaborn Visualization
1. Nice to Meet you, seaborn!
First Dive into seaborn Visualization
Histplot
A histogram (aka histplot) is a classic visualization tool that represents the distribution of one or more variables by counting the number of observations that fall within discrete bins.
An example of a histplot:
![](https://codefinity-content-media.s3.eu-west-1.amazonaws.com/c5b4ea8f-8a30-439f-9625-ddf2effbd9ac/hissttsts.png)
To initialize a histplot based on the pandas
DataFrame, we need to input at least 2 parameters: x/y
(the column in which values will be used to create a histplot) and data
(the DataFrame containing the data).
Look at the code below!
We can change the histogram binning intervals by using binwidth=n
as an argument in the plot function, n
- is the width of one column:
Let's solve this problem!
![](https://codefinity-content-media.s3.eu-west-1.amazonaws.com/c5b4ea8f-8a30-439f-9625-ddf2effbd9ac/seaborn_new/v7.png)
Task
- Import the
seaborn
withsns
alias. - Import the
matplotlib.pyplot
withplt
alias. - Import the
pandas
withpd
alias. - Read the file using
df
variable. - Create a x-oriented lineplot using
'answer'
column in the plot function. - Set
binwidth = 0.2
. - Show the plot.
Everything was clear?
Course Content
First Dive into seaborn Visualization
1. Nice to Meet you, seaborn!
First Dive into seaborn Visualization
Histplot
A histogram (aka histplot) is a classic visualization tool that represents the distribution of one or more variables by counting the number of observations that fall within discrete bins.
An example of a histplot:
![](https://codefinity-content-media.s3.eu-west-1.amazonaws.com/c5b4ea8f-8a30-439f-9625-ddf2effbd9ac/hissttsts.png)
To initialize a histplot based on the pandas
DataFrame, we need to input at least 2 parameters: x/y
(the column in which values will be used to create a histplot) and data
(the DataFrame containing the data).
Look at the code below!
We can change the histogram binning intervals by using binwidth=n
as an argument in the plot function, n
- is the width of one column:
Let's solve this problem!
![](https://codefinity-content-media.s3.eu-west-1.amazonaws.com/c5b4ea8f-8a30-439f-9625-ddf2effbd9ac/seaborn_new/v7.png)
Task
- Import the
seaborn
withsns
alias. - Import the
matplotlib.pyplot
withplt
alias. - Import the
pandas
withpd
alias. - Read the file using
df
variable. - Create a x-oriented lineplot using
'answer'
column in the plot function. - Set
binwidth = 0.2
. - Show the plot.
Everything was clear?