# 12. Seaborn - Data Visualization

<figure><img src="https://2715416193-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqrOwR7E0344TGTnSFHoL%2Fuploads%2FxWJKB1jm4UwnHLPJxE54%2Fimage.png?alt=media&#x26;token=db87b2e1-1a2d-464d-8e21-6085511afb01" alt=""><figcaption></figcaption></figure>

**Seaborn is a Python data visualization library based on matplotlib. It provides a high-level interface for drawing attractive and informative statistical graphics.**

## Install Seaborn <a href="#install-seaborn" id="install-seaborn"></a>

In \[1]:

```
pip install seaborn
```

## Get Data Repository: <a href="#get-data-repository" id="get-data-repository"></a>

When you install seaborn , it comes with datasets for you to practice on. You can go through [Data Repository](https://github.com/mwaskom/seaborn-data).

<figure><img src="https://2715416193-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqrOwR7E0344TGTnSFHoL%2Fuploads%2Flac0r7DIVJSfxPPUjT5T%2Fimage.png?alt=media&#x26;token=a14f4afa-4b96-431e-a7aa-44544891960f" alt=""><figcaption></figcaption></figure>

## Import All Libraries <a href="#import-all-libraries" id="import-all-libraries"></a>

In \[2]:

```
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
```

## Get Dataset names: <a href="#get-dataset-names" id="get-dataset-names"></a>

In \[3]:

```
sns.get_dataset_names()
```

```
['anagrams',
 'anscombe',
 'attention',
 'brain_networks',
 'car_crashes',
 'diamonds',
 'dots',
 'exercise',
 'flights',
 'fmri',
 'gammas',
 'geyser',
 'iris',
 'mpg',
 'penguins',
 'planets',
 'taxis',
 'tips',
 'titanic']
```

## Load Dataset <a href="#load-dataset" id="load-dataset"></a>

In \[4]:

```
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns

df = sns.load_dataset('tips')
df.head()
```

Out\[4]:

|   | total\_bill | tip  | sex    | smoker | day | time   | size |
| - | ----------- | ---- | ------ | ------ | --- | ------ | ---- |
| 0 | 16.99       | 1.01 | Female | No     | Sun | Dinner | 2    |
| 1 | 10.34       | 1.66 | Male   | No     | Sun | Dinner | 3    |
| 2 | 21.01       | 3.50 | Male   | No     | Sun | Dinner | 3    |
| 3 | 23.68       | 3.31 | Male   | No     | Sun | Dinner | 2    |
| 4 | 24.59       | 3.61 | Female | No     | Sun | Dinner | 4    |

## How to create your first graph <a href="#how-to-create-your-first-graph" id="how-to-create-your-first-graph"></a>

### Load Dataset <a href="#load-dataset" id="load-dataset"></a>

We use **load\_dataset** method to load datasets from data repository.

In \[5]:

```
sns.load_dataset('tips')
```

Out\[5]:

|     | total\_bill | tip  | sex    | smoker | day  | time   | size |
| --- | ----------- | ---- | ------ | ------ | ---- | ------ | ---- |
| 0   | 16.99       | 1.01 | Female | No     | Sun  | Dinner | 2    |
| 1   | 10.34       | 1.66 | Male   | No     | Sun  | Dinner | 3    |
| 2   | 21.01       | 3.50 | Male   | No     | Sun  | Dinner | 3    |
| 3   | 23.68       | 3.31 | Male   | No     | Sun  | Dinner | 2    |
| 4   | 24.59       | 3.61 | Female | No     | Sun  | Dinner | 4    |
| ... | ...         | ...  | ...    | ...    | ...  | ...    | ...  |
| 239 | 29.03       | 5.92 | Male   | No     | Sat  | Dinner | 3    |
| 240 | 27.18       | 2.00 | Female | Yes    | Sat  | Dinner | 2    |
| 241 | 22.67       | 2.00 | Male   | Yes    | Sat  | Dinner | 2    |
| 242 | 17.82       | 1.75 | Male   | No     | Sat  | Dinner | 2    |
| 243 | 18.78       | 3.00 | Female | No     | Thur | Dinner | 2    |

244 rows × 7 columns

Creating graph with the help of seaborn is as easy as matplotlib.Suppose we want to create a **scatter plot** of relationship between **Totalbill** and **tips**. All you need to do is to use **scatterplot** method.

***Note :We use scatterplot() method to create scatter plot instead of scatter like we used to do in matplotlib.***

```
sns.scatterplot(x='total_bill',y='tip',data=df)
plt.show()
```

<figure><img src="https://2715416193-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqrOwR7E0344TGTnSFHoL%2Fuploads%2FCrpu1Rvs7bMHI6L7t5T1%2Fimage.png?alt=media&#x26;token=9a076817-c91f-4782-a9eb-40bd19538ca9" alt=""><figcaption></figcaption></figure>

### hue: <a href="#hue" id="hue"></a>

hue : (optional) This parameter take column name for colour encoding.

Suppose we also want to know smokers along with total\_bill and tip. We can show this third information with the help of hue.

In \[7]:

```
sns.scatterplot(x='total_bill',y='tip',hue='smoker',data=df)
plt.show()
```

<figure><img src="https://2715416193-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqrOwR7E0344TGTnSFHoL%2Fuploads%2FigDGpoVbjJEm12FUNVja%2Fimage.png?alt=media&#x26;token=a2283979-bb0d-40d7-a57a-f840fa83737b" alt=""><figcaption></figcaption></figure>

You can also change order of hue by using hue\_order property.

In \[9]:

```
sns.scatterplot(x='total_bill',y='tip',hue='smoker',hue_order=['No','Yes'],data=df)
plt.show()
```

<figure><img src="https://2715416193-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqrOwR7E0344TGTnSFHoL%2Fuploads%2FkwjQvSMD5WVB0AXNEeby%2Fimage.png?alt=media&#x26;token=93e1db87-2905-484a-8177-ebeeb63730e3" alt=""><figcaption></figcaption></figure>

### Palette: <a href="#palette" id="palette"></a>

**What if you want to change color encoding for smokers and non-smokers.**

For this you can use ***palette*** property.

In \[11]:

```
c = {'No':'Green','Yes':'Red'}
sns.scatterplot(x='total_bill',y='tip',hue='smoker',hue_order=['No','Yes'],palette = c,data=df)
plt.show()
```

<figure><img src="https://2715416193-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqrOwR7E0344TGTnSFHoL%2Fuploads%2FUyNT6gx2dt7c9lllDMiN%2Fimage.png?alt=media&#x26;token=007d9621-25ba-4932-ac93-316067e7f2b3" alt=""><figcaption></figcaption></figure>

**smoker** is a categorical value , but you can also use any numerical value in hue. Let's say i want to color encode sizes.

In \[12]:

```
# sns.scatterplot(x='total_bill',y='tip',hue='size',data=df)
# plt.show()
```

<figure><img src="https://2715416193-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqrOwR7E0344TGTnSFHoL%2Fuploads%2FVUwL8ABH4CdOdypqoKNH%2Fimage.png?alt=media&#x26;token=615c87de-e466-4268-b15e-ca8e0c7c969d" alt=""><figcaption></figcaption></figure>

## relplot: <a href="#relplot" id="relplot"></a>

relplot is used for many purposes , but the main purpose behind using replot is **sub-plotting**. Suppose we want to suplot our graph based on **smoker** and **non-smoker**.

We can use **row**,**col** to achieve this result.

Let's see this with an example.

In \[14]:

```
sns.relplot(x='total_bill',y='tip',data=df,col='smoker')
plt.show()
```

<figure><img src="https://2715416193-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqrOwR7E0344TGTnSFHoL%2Fuploads%2FkbHMzDkEsz49oPktjsUi%2Fimage.png?alt=media&#x26;token=5d6d7b6d-fdac-47bc-b4bf-41577dc728c8" alt=""><figcaption></figcaption></figure>

What if i used **row** property.

In \[15]:

```
# sns.relplot(x='total_bill',y='tip',data=df,row='smoker')
# plt.show()
```

<figure><img src="https://2715416193-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqrOwR7E0344TGTnSFHoL%2Fuploads%2FfyQ1xzZouu5ipeMTur3Q%2Fimage.png?alt=media&#x26;token=e7dc3164-e874-4e67-bf9b-91a187020f7a" alt=""><figcaption></figcaption></figure>

Graph would have appeared like this.

We can do same with size by choosing col as size.

In \[17]:

```
# %matplotlib notebook
# sns.relplot(x='total_bill',y='tip',hue='size',data=df,col='size')
# plt.show()
```

<figure><img src="https://2715416193-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqrOwR7E0344TGTnSFHoL%2Fuploads%2F8uvcxeozVudQKb2IuxJR%2Fimage.png?alt=media&#x26;token=52471de1-4147-467f-878c-9310226e98a9" alt=""><figcaption></figcaption></figure>

Now as you can see it has one column and all the graphs are in a single column. We can use col\_wrap to restrict number of graphs in a single column.

In \[21]:

```
# %matplotlib inline
# sns.relplot(x='total_bill',y='tip',hue='size',data=df,col='size',col_wrap=3)
# plt.show()
```

<figure><img src="https://2715416193-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqrOwR7E0344TGTnSFHoL%2Fuploads%2F7PoynQG6VvKeZIcPd5mI%2Fimage.png?alt=media&#x26;token=3f57ef03-4b44-4c66-8eaa-3690a6340e4d" alt=""><figcaption></figcaption></figure>

## Applying Row and Column property in a single plot <a href="#applying-row-and-column-property-in-a-single-plot" id="applying-row-and-column-property-in-a-single-plot"></a>

what if i want to see data of smokers in column and data of time in rows, we can use col and row property in a single plot.

In \[22]:

```
sns.relplot(x='total_bill',y='tip',data=df,row='time',col='smoker')
plt.show()
```

<figure><img src="https://2715416193-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqrOwR7E0344TGTnSFHoL%2Fuploads%2FiBIUmrXrvt2e5XOTVZhq%2Fimage.png?alt=media&#x26;token=edd8e06e-9421-45c0-a0a0-16df4158fe82" alt=""><figcaption></figcaption></figure>

### using categorical column <a href="#using-categorical-column" id="using-categorical-column"></a>

what if one of my axis is categorical column ?

In \[23]:

```
# sns.relplot(x='total_bill',y='time',data=df)
# plt.show()

```

<figure><img src="https://2715416193-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqrOwR7E0344TGTnSFHoL%2Fuploads%2FByUdhkI5ouYjdQOjXv8y%2Fimage.png?alt=media&#x26;token=5094e8ee-f13c-438d-b678-94ef767d4317" alt=""><figcaption></figcaption></figure>

relplot offers a property **size** that changes the size of values. Let's see this with an example.

In \[25]:

```
sns.relplot(x='total_bill',y='tip',data=df,size='size')
plt.show()

```

<figure><img src="https://2715416193-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqrOwR7E0344TGTnSFHoL%2Fuploads%2FGGH3yLMyDArHPhLLaAAo%2Fimage.png?alt=media&#x26;token=f9e3074d-553b-416c-b7bb-7aa65f2add71" alt=""><figcaption></figcaption></figure>

## A Useful Example <a href="#a-useful-example" id="a-useful-example"></a>

Seaborn offers another dataset named **flights**. Let's see this data first.

In \[13]:

```
import matplotlib.pyplot as plt
import seaborn as sns
df = sns.load_dataset('flights')
df
```

Out\[13]:

|     | year | month | passengers |
| --- | ---- | ----- | ---------- |
| 0   | 1949 | Jan   | 112        |
| 1   | 1949 | Feb   | 118        |
| 2   | 1949 | Mar   | 132        |
| 3   | 1949 | Apr   | 129        |
| 4   | 1949 | May   | 121        |
| ... | ...  | ...   | ...        |
| 139 | 1960 | Aug   | 606        |
| 140 | 1960 | Sep   | 508        |
| 141 | 1960 | Oct   | 461        |
| 142 | 1960 | Nov   | 390        |
| 143 | 1960 | Dec   | 432        |

144 rows × 3 columns

If we want to know how many passengers were on board on a particular month and year.

In \[7]:

```
sns.relplot(x='passengers',y='month',hue = 'year',data=df)
```

<figure><img src="https://2715416193-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqrOwR7E0344TGTnSFHoL%2Fuploads%2FcWkl0QAbMgWT67SEfnZf%2Fimage.png?alt=media&#x26;token=aa0a25a9-8abe-4c34-9e19-17978f7d7268" alt=""><figcaption></figcaption></figure>

## Categorical column and relplot <a href="#categorical-column-and-relplot" id="categorical-column-and-relplot"></a>

Whenever there is a categorical column and a numerical column , we donot use relplot. Let me show you why?

In \[15]:

```
import matplotlib.pyplot as plt
import seaborn as sns

df = sns.load_dataset('tips')
sns.relplot(x='time',y='tip',data=df)
```

<figure><img src="https://2715416193-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqrOwR7E0344TGTnSFHoL%2Fuploads%2FrdzdyaDLYuVDEd59HFxm%2Fimage.png?alt=media&#x26;token=4f5c5e7b-0927-4da3-a520-ffbba829e060" alt=""><figcaption></figcaption></figure>

This obviously is not a clear graph. So whenever we deal with categorical column we use catplot(categorical plot).

## Catplot <a href="#catplot" id="catplot"></a>

Categorical plot is always a best option if one value is Categorical and another is numerical.

In \[17]:

```
import matplotlib.pyplot as plt
import seaborn as sns

df = sns.load_dataset('tips')
sns.catplot(x='time',y='tip',data=df)
```

<figure><img src="https://2715416193-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqrOwR7E0344TGTnSFHoL%2Fuploads%2FI0fq1sPEetJtdsNMbaD8%2Fimage.png?alt=media&#x26;token=dfaea4c5-fa4c-4889-9251-c07c4694acd8" alt=""><figcaption></figcaption></figure>

## A Useful example <a href="#a-useful-example" id="a-useful-example"></a>

Suppose we want to know **total bill** dayswise , we can use catplot as day is a categorical plot while total bill is numerical.

In \[23]:

```
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd

df = sns.load_dataset('tips')
sns.catplot(x='total_bill',y='day',data=df)
plt.show()
```

<figure><img src="https://2715416193-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqrOwR7E0344TGTnSFHoL%2Fuploads%2FDM1U63NbdGj4V14lfh06%2Fimage.png?alt=media&#x26;token=512173ba-3d0f-4e42-a7e7-ab8df229a38a" alt=""><figcaption></figcaption></figure>

You can change graph to bar by using **kind = 'bar'** property.

In \[25]:

```
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd

df = sns.load_dataset('tips')
sns.catplot(x='total_bill',y='day',data=df,kind='bar')
plt.show()
```

<figure><img src="https://2715416193-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqrOwR7E0344TGTnSFHoL%2Fuploads%2FUYx6qlKwS30vEp4u7dcO%2Fimage.png?alt=media&#x26;token=029495c1-b355-483c-9a3b-b57b4770dee8" alt=""><figcaption></figcaption></figure>

You can change graph to bar by using **kind = 'point'** property.

In \[27]:

```
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd

df = sns.load_dataset('tips')
sns.catplot(x='total_bill',y='day',data=df,kind='point')
plt.show()
```

<figure><img src="https://2715416193-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqrOwR7E0344TGTnSFHoL%2Fuploads%2FJKS0vDk27zPk8TARA7me%2Fimage.png?alt=media&#x26;token=4e5ddcc3-0da4-4c42-85ce-bd8c2f410144" alt=""><figcaption></figcaption></figure>

You can change graph to bar by using **kind = 'violin'** property.

In \[29]:

```
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd

df = sns.load_dataset('tips')
sns.catplot(x='total_bill',y='day',data=df,kind='violin')
plt.grid()
plt.show()
```

<figure><img src="https://2715416193-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqrOwR7E0344TGTnSFHoL%2Fuploads%2FYaQqhElVSQ4GjuXy0ZDz%2Fimage.png?alt=media&#x26;token=1bb5642a-1d85-46e1-ad6e-3ab359ae5ab9" alt=""><figcaption></figcaption></figure>

From this violin chart it is very easy to figure out pattern of bills that were given on any day. Like on thursday most of the total bill were between 10 to 20 dollars.

You can change graph to bar by using **kind = 'boxen'** property.

In \[31]:

```
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd

df = sns.load_dataset('tips')
sns.catplot(x='day',y='total_bill',data=df,kind='boxen')
plt.grid()
plt.show()
```

<figure><img src="https://2715416193-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqrOwR7E0344TGTnSFHoL%2Fuploads%2FUMnx4CTK39HhKOPoVB70%2Fimage.png?alt=media&#x26;token=23e2cae2-06fa-4444-892d-e4ba872611ae" alt=""><figcaption></figcaption></figure>

Boxen chart also works like violin chart.\
**The only difference is Boxen chart assigns darkest colour to the area where most of the data lies.**

**As you can see a horizontal line , this horizontal line is median of the data.**

**dots that you see in boxen chart are outliers**

You can change graph to bar by using **kind = 'box'** property.

In \[32]:

```
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd

df = sns.load_dataset('tips')
sns.catplot(x='day',y='total_bill',data=df,kind='box')
plt.grid()
plt.show()
```

<figure><img src="https://2715416193-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqrOwR7E0344TGTnSFHoL%2Fuploads%2FtjpClKauF5RtfasiKZ6s%2Fimage.png?alt=media&#x26;token=af8bd9a0-d4c0-4ba4-b127-638a2e2fdaca" alt=""><figcaption></figcaption></figure>

## Countplot <a href="#countplot" id="countplot"></a>

seaborn.countplot() method is used to Show the counts of observations in each categorical bin.

```
import matplotlib.pyplot as plt
import seaborn as sns

df = sns.load_dataset('tips')
sns.countplot(y='smoker',data=df)
```

<figure><img src="https://2715416193-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqrOwR7E0344TGTnSFHoL%2Fuploads%2FYcFrg1uCcsWutfFwdwR0%2Fimage.png?alt=media&#x26;token=c6d6a385-da35-46e3-82fd-bf4ae05279e2" alt=""><figcaption></figcaption></figure>

## A Useful Example <a href="#a-useful-example" id="a-useful-example"></a>

Suppose we want to count **Type 1** of pokemon in our pokemon dataset. We can use countplot here.

In \[22]:

```
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd

df = pd.read_csv('Pokemon.csv')
sns.countplot(y='Type 1',data=df)
```

<figure><img src="https://2715416193-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqrOwR7E0344TGTnSFHoL%2Fuploads%2F3BjYHUfujri9OsZ4bizu%2Fimage.png?alt=media&#x26;token=12a6d8c3-0393-42f6-acdb-dffa7125cb09" alt=""><figcaption></figcaption></figure>

## Introduction to pairplot: <a href="#introduction-to-pairplot" id="introduction-to-pairplot"></a>

Plot pairwise relationships in a dataset.

By default, this function will create a grid of Axes such that each numeric variable in data will by shared across the y-axes across a single row and the x-axes across a single column.

In \[35]:

```
import matplotlib.pyplot as plt
import seaborn as sns

df = sns.load_dataset('tips')
sns.pairplot(data = df)
plt.show()
```

![](https://2715416193-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqrOwR7E0344TGTnSFHoL%2Fuploads%2FsyHpBRSA3r6Pwn99myHJ%2Fimage.png?alt=media\&token=a354c2b0-8a56-410f-ae52-e980e75a6818)

You can also add hue property to see gender of customers.

In \[36]:

```
import matplotlib.pyplot as plt
import seaborn as sns

df = sns.load_dataset('tips')
sns.pairplot(data = df,hue='sex')
plt.show()
```

<figure><img src="https://2715416193-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqrOwR7E0344TGTnSFHoL%2Fuploads%2Fx7yNCyEpRU6NLwRpOLCy%2Fimage.png?alt=media&#x26;token=8d0843d4-19e3-4dbb-bbd5-c8e1461bc591" alt=""><figcaption></figcaption></figure>

## A Useful Example : <a href="#a-useful-example" id="a-useful-example"></a>

In \[38]:

```
import matplotlib.pyplot as plt
import seaborn as sns

df = sns.load_dataset('iris')
df
```

|     | sepal\_length | sepal\_width | petal\_length | petal\_width | species   |
| --- | ------------- | ------------ | ------------- | ------------ | --------- |
| 0   | 5.1           | 3.5          | 1.4           | 0.2          | setosa    |
| 1   | 4.9           | 3.0          | 1.4           | 0.2          | setosa    |
| 2   | 4.7           | 3.2          | 1.3           | 0.2          | setosa    |
| 3   | 4.6           | 3.1          | 1.5           | 0.2          | setosa    |
| 4   | 5.0           | 3.6          | 1.4           | 0.2          | setosa    |
| ... | ...           | ...          | ...           | ...          | ...       |
| 145 | 6.7           | 3.0          | 5.2           | 2.3          | virginica |
| 146 | 6.3           | 2.5          | 5.0           | 1.9          | virginica |
| 147 | 6.5           | 3.0          | 5.2           | 2.0          | virginica |
| 148 | 6.2           | 3.4          | 5.4           | 2.3          | virginica |
| 149 | 5.9           | 3.0          | 5.1           | 1.8          | virginica |

150 rows × 5 columns

## Check Range of Sepal length for species: <a href="#check-range-of-sepal-length-for-species" id="check-range-of-sepal-length-for-species"></a>

Now as we have discussed before in the note, whenever we are dealing with ranges , Histogram is always a better option. So let us create a histogram for species and their sepal length.

In \[40]:

```
import matplotlib.pyplot as plt
import seaborn as sns

df = sns.load_dataset('iris')
f = sns.FacetGrid(data = df,col='species')
f.map(plt.hist,'sepal_length')
plt.show()
```

<figure><img src="https://2715416193-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqrOwR7E0344TGTnSFHoL%2Fuploads%2FN87E7mTtgyFa3BOGsHGi%2Fimage.png?alt=media&#x26;token=ebbe860e-e2dd-46a6-a364-447969187cf8" alt=""><figcaption></figcaption></figure>
