{"id":20709,"date":"2021-07-26T13:21:00","date_gmt":"2021-07-26T07:51:00","guid":{"rendered":"https:\/\/www.mygreatlearning.com\/blog\/seaborn-tutorial\/"},"modified":"2024-09-02T15:24:28","modified_gmt":"2024-09-02T09:54:28","slug":"seaborn-tutorial","status":"publish","type":"post","link":"https:\/\/www.mygreatlearning.com\/blog\/seaborn-tutorial\/","title":{"rendered":"Seaborn Tutorial in Python For Beginners"},"content":{"rendered":"\n<p>Seaborn is an amazing <a href=\"https:\/\/www.mygreatlearning.com\/blog\/what-is-data-visualization\/\">data visualization<\/a> library for statistical graphics plotting in <a aria-label=\"Python (opens in a new tab)\" href=\"https:\/\/www.mygreatlearning.com\/blog\/python-tutorial-for-beginners-a-complete-guide\/\" target=\"_blank\" rel=\"noreferrer noopener\">Python<\/a>. It provides beautiful default styles and colour palettes to make statistical plots more attractive. It is built on the top of the <a aria-label=\"matplotlib (opens in a new tab)\" href=\"https:\/\/www.mygreatlearning.com\/blog\/matplotlib-tutorial-for-data-visualisation\/\" target=\"_blank\" rel=\"noreferrer noopener\">matplotlib<\/a> library and also closely integrated to the data structures from pandas. In this tutorial, we shall see how to use seaborn to make a variety of plots and how we can use it along with matplotlib to make our plots more attractive.<\/p>\n\n\n\n    <div class=\"courses-cta-container\">\n        <div class=\"courses-cta-card\">\n            <div class=\"courses-cta-header\">\n                <div class=\"courses-learn-icon\"><\/div>\n                <span class=\"courses-learn-text\">Academy Pro<\/span>\n            <\/div>\n            <p class=\"courses-cta-title\">\n                <a href=\"https:\/\/www.mygreatlearning.com\/academy\/premium\/master-python-programming\" class=\"courses-cta-title-link\">Python Programming Course<\/a>\n            <\/p>\n            <p class=\"courses-cta-description\">In this course, you will learn the fundamentals of Python: from basic syntax to mastering data structures, loops, and functions. You will also explore OOP concepts and objects to build robust programs.<\/p>\n            <div class=\"courses-cta-stats\">\n                <div class=\"courses-stat-item\">\n                    <div class=\"courses-stat-icon courses-user-icon\"><\/div>\n                    <span>11.5 Hrs<\/span>\n                <\/div>\n                <div class=\"courses-stat-item\">\n                    <div class=\"courses-stat-icon courses-star-icon\"><\/div>\n                    <span>51 Coding Exercises<\/span>\n                <\/div>\n            <\/div>\n            <a href=\"https:\/\/www.mygreatlearning.com\/academy\/premium\/master-python-programming\" class=\"courses-cta-button\">\n                Start Free Trial\n                <div class=\"courses-arrow-icon\"><\/div>\n            <\/a>\n        <\/div>\n    <\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"installing-seaborn-and-getting-started\"><strong>Installing Seaborn and getting started<\/strong><\/h2>\n\n\n\n<p>Before using Seaborn, we need to install it and here I am going to show various ways of installing it on your computer.<\/p>\n\n\n\n<p><strong>Using Pip Installer<\/strong><\/p>\n\n\n\n<p>pip is a de facto standard package-management system used to install and manage software packages written in Python.&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">pip install seaborn<\/pre>\n\n\n\n<p><strong>Using Anaconda<\/strong><\/p>\n\n\n\n<p>Anaconda is a package manager, an environment manager, and Python distribution that contains a collection of many open source packages. If you need additional packages after installing Anaconda, you can use Anaconda\u2019s package manager or conda to install those packages.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">conda install seaborn<\/pre>\n\n\n\n<p>You can also install the development version of Seaborn directly from GitHub by using this command in the command prompt.<br><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">pip install git+https:\/\/github.com\/mwaskom\/seaborn.git#egg=seaborn<\/pre>\n\n\n\n<p>Also, make sure you have the following dependencies installed on your computer:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Python 3.6+<\/li>\n\n\n\n<li>NumPy<\/li>\n\n\n\n<li>SciPy<\/li>\n\n\n\n<li>Pandas<\/li>\n\n\n\n<li>Matplotlib<\/li>\n\n\n\n<li>Statsmodels(optional,but recommended)<\/li>\n<\/ul>\n\n\n\n<p>Check out <a href=\"https:\/\/www.mygreatlearning.com\/academy\/learn-for-free\/courses\/python-seaborn\" target=\"_blank\" rel=\"noreferrer noopener\">python seaborn<\/a> courses to understand more about seaborn.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"load-data-to-construct-seaborn-plots\"><strong>Load Data To Construct Seaborn Plots<\/strong><\/h2>\n\n\n\n<p>In this section, we are going to see how to import in-built datasets from seaborn that are automatically downloaded at the time of installation. You can also use Pandas to import any dataset but using in-built datasets can come really handy when practising&nbsp; Seaborn. Here is how we can get a list of all datasets that are in-built in Seaborn<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; gutter: false; title: ; notranslate\" title=\"\">\nimport pandas\nimport matplotlib\nimport scipy\nimport seaborn as sns\nprint(sns.get_dataset_names())\n<\/pre><\/div>\n\n\n<pre class=\"wp-block-code\"><code>Output:\n&#091;'anagrams', 'anscombe', 'attention', 'brain_networks',\n 'car_crashes', 'diamonds', 'dots', 'exercise', 'flights',\n 'fmri', 'gammas', 'geyser', 'iris', 'mpg', 'penguins',\n 'planets', 'tips', 'titanic']\n<\/code><\/pre>\n\n\n\n<p>Now let us import any one of those datasets and visualize the data in the coming sections<br><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport seaborn as sns\ndf = sns.load_dataset(&#039;car_crashes&#039;)\nprint(df.head())\n<\/pre><\/div>\n\n\n<pre class=\"wp-block-code\"><code>Output:\n  total  speeding  alcohol  ...  ins_premium  ins_losses  abbrev\n0   18.8     7.332    5.640  ...       784.55      145.08      AL\n1   18.1     7.421    4.525  ...      1053.48      133.93      AK\n2   18.6     6.510    5.208  ...       899.47      110.35      AZ\n3   22.4     4.032    5.824  ...       827.34      142.39      AR\n4   12.0     4.200    3.360  ...       878.41      165.63      CA\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"styling-and-themes-in-seaborn\"><strong>Styling and Themes in Seaborn<\/strong><\/h2>\n\n\n\n<p>We use visualizations to get insights from a huge amount of data or present our insights to the stakeholders and making these visualizations more pleasing can surely help with both of these. People are more likely to concentrate on beautiful and attractive visualizations rather than dull plots thus styling can be considered as a vital component of data visualization.<\/p>\n\n\n\n<p>Matplotlib library is highly customizable, but it may be hard for us to tweak the right setting to get an attractive and good looking plot. Unlike Matplotlib, Seaborn comes packed with customized themes and a high-level interface for customizing and controlling the look of Matplotlib figures.<\/p>\n\n\n\n<p>First, let us see how we can style a simple Matplotlib plot using Seaborn\u2019s set() function.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nfrom matplotlib import pyplot as plt\nimport seaborn as sns\nplt.scatter(df.speeding,df.alcohol)\nplt.show()\n<\/pre><\/div>\n\n\n<p>Output:<\/p>\n\n\n<figure class=\"wp-block-image aligncenter size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/1-2.png\"><img decoding=\"async\" width=\"368\" height=\"248\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/1-2.png\" alt=\"\" class=\"wp-image-20712\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/1-2.png 368w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/1-2-300x202.png 300w\" sizes=\"(max-width: 368px) 100vw, 368px\" \/><\/figure>\n\n\n\n<p>Now let us see how we can style this plot using the set() function<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nfrom matplotlib import pyplot as plt\nimport seaborn as sns\nplt.scatter(df.speeding,df.alcohol)\nsns.set()\nplt.show()\n<\/pre><\/div>\n\n\n<p>Output:<\/p>\n\n\n<figure class=\"wp-block-image aligncenter size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/2-2.png\"><img decoding=\"async\" width=\"372\" height=\"251\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/2-2.png\" alt=\"\" class=\"wp-image-20713\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/2-2.png 372w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/2-2-300x202.png 300w\" sizes=\"(max-width: 372px) 100vw, 372px\" \/><\/figure>\n\n\n\n<p>The above two figures show the difference in the default Matplotlib and Seaborn plots. The representation of data is the same, but there is a slight difference in the styling of these plots.<\/p>\n\n\n\n<p>Seaborn supports various themes that can make styling the plots really easy and save a lot of time. Using the set_style() function of Seaborn we can set any of the themes available on Seaborn library. Here are a few of the popular themes:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Darkgrid<\/li>\n\n\n\n<li>Whitegrid<\/li>\n\n\n\n<li>Dark<\/li>\n\n\n\n<li>White<\/li>\n\n\n\n<li>Ticks<\/li>\n<\/ul>\n\n\n\n<p>Let us try applying these themes and see how they differ from one another. The default theme of the plot will be Darkgrid which we have seen in the previous example.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nfrom matplotlib import pyplot as plt\nimport seaborn as sns\nplt.scatter(df.speeding,df.alcohol)\nsns.set_style(&quot;whitegrid&quot;)\nplt.show()\n<\/pre><\/div>\n\n<figure class=\"wp-block-image aligncenter size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/3-2.png\"><img decoding=\"async\" width=\"372\" height=\"251\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/3-2.png\" alt=\"\" class=\"wp-image-20714\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/3-2.png 372w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/3-2-300x202.png 300w\" sizes=\"(max-width: 372px) 100vw, 372px\" \/><\/figure>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nfrom matplotlib import pyplot as plt\nimport seaborn as sns\nplt.scatter(df.speeding,df.alcohol)\nsns.set_style(&quot;dark&quot;)\nplt.show()\n<\/pre><\/div>\n\n<figure class=\"wp-block-image aligncenter size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/4-3.png\"><img decoding=\"async\" width=\"368\" height=\"248\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/4-3.png\" alt=\"\" class=\"wp-image-20715\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/4-3.png 368w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/4-3-300x202.png 300w\" sizes=\"(max-width: 368px) 100vw, 368px\" \/><\/figure>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nfrom matplotlib import pyplot as plt\nimport seaborn as sns\nplt.scatter(df.speeding,df.alcohol)\nsns.set_style(&quot;white&quot;)\nplt.show()\n<\/pre><\/div>\n\n<figure class=\"wp-block-image aligncenter size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/5-3.png\"><img decoding=\"async\" width=\"372\" height=\"251\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/5-3.png\" alt=\"\" class=\"wp-image-20716\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/5-3.png 372w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/5-3-300x202.png 300w\" sizes=\"(max-width: 372px) 100vw, 372px\" \/><\/figure>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nfrom matplotlib import pyplot as plt\nimport seaborn as sns\nplt.scatter(df.speeding,df.alcohol)\nsns.set_style(&quot;ticks&quot;)\nplt.show()\n<\/pre><\/div>\n\n<figure class=\"wp-block-image aligncenter size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/6-4.png\"><img decoding=\"async\" width=\"372\" height=\"251\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/6-4.png\" alt=\"\" class=\"wp-image-20717\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/6-4.png 372w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/6-4-300x202.png 300w\" sizes=\"(max-width: 372px) 100vw, 372px\" \/><\/figure>\n\n\n\n<p>But we usually don\u2019t make our plots as the above one as we do not include the top and right axis spines. We can remove the top and right axis spines using the despine() function.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nfrom matplotlib import pyplot as plt\nimport seaborn as sns\nplt.scatter(df.speeding,df.alcohol)\nsns.set_style(&quot;ticks&quot;)\nsns.despine()\nplt.show()\n<\/pre><\/div>\n\n<figure class=\"wp-block-image aligncenter size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/7-2.png\"><img decoding=\"async\" width=\"372\" height=\"251\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/7-2.png\" alt=\"\" class=\"wp-image-20719\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/7-2.png 372w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/7-2-300x202.png 300w\" sizes=\"(max-width: 372px) 100vw, 372px\" \/><\/figure>\n\n\n\n<p>But having just a limited number of themes might not be that great as we always wish for some flexibility. Keeping this mind, these styles are customizable and can be customized by passing a dictionary of parameters to the set_style() function of Seaborn library. Parameters available are viewed using axes_style() function as shown below:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport seaborn as sns\nparam=sns.axes_style()\nparam\n<\/pre><\/div>\n\n\n<pre class=\"wp-block-code\"><code>Output:\n{'axes.axisbelow': True,\n 'axes.edgecolor': '.15',\n 'axes.facecolor': 'white',\n 'axes.grid': False,\n 'axes.labelcolor': '.15',\n 'axes.spines.bottom': True,\n 'axes.spines.left': True,\n 'axes.spines.right': True,\n 'axes.spines.top': True,\n 'figure.facecolor': 'white',\n 'font.family': &#091;'sans-serif'],\n 'font.sans-serif': &#091;'Arial',\n  'DejaVu Sans',\n  'Liberation Sans',\n  'Bitstream Vera Sans',\n  'sans-serif'],\n 'grid.color': '.8',\n 'grid.linestyle': '-',\n 'image.cmap': 'rocket',\n 'lines.solid_capstyle': 'round',\n 'patch.edgecolor': 'w',\n 'patch.force_edgecolor': True,\n 'text.color': '.15',\n 'xtick.bottom': True,\n 'xtick.color': '.15',\n 'xtick.direction': 'out',\n 'xtick.top': False,\n 'ytick.color': '.15',\n 'ytick.direction': 'out',\n 'ytick.left': True,\n 'ytick.right': False}<\/code><\/pre>\n\n\n\n<p>Changing the values of any of these parameters will alter the plot style and thus we can try various things out to make our plots really different and attractive.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nfrom matplotlib import pyplot as plt\nimport seaborn as sns\nplt.scatter(&#039;speeding&#039;,&#039;alcohol&#039;,data=df)\nsns.set_style(&quot;darkgrid&quot;, {&#039;grid.color&#039;: &#039;.5&#039;})\nsns.despine()\nplt.show()\n<\/pre><\/div>\n\n<figure class=\"wp-block-image aligncenter size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/8-2.png\"><img decoding=\"async\" width=\"372\" height=\"251\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/8-2.png\" alt=\"\" class=\"wp-image-20720\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/8-2.png 372w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/8-2-300x202.png 300w\" sizes=\"(max-width: 372px) 100vw, 372px\" \/><\/figure>\n\n\n\n<p>Seaborn also allows us to control individual elements of our graphs and thus we can control the scale of these elements or the plot by using the set_context() function. We have four preset templates for contexts, based on relative size, the contexts are named as follows<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Paper<\/li>\n\n\n\n<li>Notebook<\/li>\n\n\n\n<li>Talk<\/li>\n\n\n\n<li>Poster<\/li>\n<\/ul>\n\n\n\n<p>By default, context is set to notebook and all of the examples above have the context set to \u2018notebook\u2019.Now let us try any other context and see how it affects our plots.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nfrom matplotlib import pyplot as plt\nimport seaborn as sns\nplt.scatter(df.speeding,df.alcohol)\nsns.set_style(&quot;dark&quot;)\nsns.set_context(&quot;notebook&quot;)\nplt.show()\n<\/pre><\/div>\n\n<figure class=\"wp-block-image aligncenter size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/9-1.png\"><img decoding=\"async\" width=\"372\" height=\"251\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/9-1.png\" alt=\"\" class=\"wp-image-20721\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/9-1.png 372w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/9-1-300x202.png 300w\" sizes=\"(max-width: 372px) 100vw, 372px\" \/><\/figure>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nfrom matplotlib import pyplot as plt\nimport seaborn as sns\nplt.scatter(df.speeding,df.alcohol)\nsns.set_style(&quot;dark&quot;)\nsns.set_context(&quot;poster&quot;)\nplt.show()\n<\/pre><\/div>\n\n<figure class=\"wp-block-image aligncenter size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/10-2.png\"><img decoding=\"async\" width=\"413\" height=\"267\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/10-2.png\" alt=\"\" class=\"wp-image-20722\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/10-2.png 413w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/10-2-300x194.png 300w\" sizes=\"(max-width: 413px) 100vw, 413px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"seaborn-color-palette\"><strong>Seaborn Color Palette<\/strong><\/h2>\n\n\n\n<p>Seaborn has a reputation for making plots and graphs more attractive using attractive colors and color combinations. In data visualization, color is necessarily involved, and colors have an influence on their observer.Color plays an important role than any other aspect in the visualizations. When used effectively, color adds more value to the plot. A palette means a flat surface on which a painter arranges and mixes paints. Here I'll show some of the color palettes out of the 170 palettes offered by Seaborn.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsns.palplot(sns.color_palette(&quot;deep&quot;, 10))\n<\/pre><\/div>\n\n<figure class=\"wp-block-image aligncenter size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/11-1.png\"><img decoding=\"async\" width=\"572\" height=\"68\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/11-1.png\" alt=\"\" class=\"wp-image-20723\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/11-1.png 572w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/11-1-300x36.png 300w\" sizes=\"(max-width: 572px) 100vw, 572px\" \/><\/figure>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsns.palplot(sns.color_palette(&quot;PiYG&quot;, 10))\n<\/pre><\/div>\n\n<figure class=\"wp-block-image aligncenter size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/12.png\"><img decoding=\"async\" width=\"572\" height=\"68\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/12.png\" alt=\"\" class=\"wp-image-20724\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/12.png 572w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/12-300x36.png 300w\" sizes=\"(max-width: 572px) 100vw, 572px\" \/><\/figure>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsns.palplot(sns.color_palette(&quot;GnBu&quot;, 10))\n<\/pre><\/div>\n\n<figure class=\"wp-block-image aligncenter size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/13.png\"><img decoding=\"async\" width=\"572\" height=\"68\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/13.png\" alt=\"\" class=\"wp-image-20725\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/13.png 572w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/13-300x36.png 300w\" sizes=\"(max-width: 572px) 100vw, 572px\" \/><\/figure>\n\n\n\n<p>Here is a list of palettes you can try out on your own.You will see a lot of use of these color palettes in the coming plots. <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">'Accent', 'Accent_r', 'Blues', 'Blues_r', 'BrBG', \n'BrBG_r', 'BuGn', 'BuGn_r', 'BuPu', 'BuPu_r', 'CMRmap',\n 'CMRmap_r', 'Dark2', 'Dark2_r', 'GnBu', 'GnBu_r', \n'Greens', 'Greens_r', 'Greys', 'Greys_r', 'OrRd', \n'OrRd_r', 'Oranges', 'Oranges_r', 'PRGn', 'PRGn_r',\n 'Paired', 'Paired_r', 'Pastel1', 'Pastel1_r', 'Pastel2', \n'Pastel2_r', 'PiYG', 'PiYG_r', 'PuBu', 'PuBuGn', 'PuBuGn_r', \n'PuBu_r', 'PuOr', 'PuOr_r', 'PuRd', 'PuRd_r', 'Purples', \n'Purples_r', 'RdBu', 'RdBu_r', 'RdGy', 'RdGy_r', 'RdPu',\n 'RdPu_r', 'RdYlBu', 'RdYlBu_r', 'RdYlGn', 'RdYlGn_r',\n 'Reds', 'Reds_r', 'Set1', 'Set1_r', 'Set2', 'Set2_r', \n'Set3', 'Set3_r', 'Spectral', 'Spectral_r', 'Wistia',\n 'Wistia_r', 'YlGn', 'YlGnBu', 'YlGnBu_r', 'YlGn_r',\n 'YlOrBr', 'YlOrBr_r', 'YlOrRd', 'YlOrRd_r', 'afmhot', \n'afmhot_r', 'autumn', 'autumn_r', 'binary', 'binary_r',\n 'bone', 'bone_r', 'brg', 'brg_r', 'bwr', 'bwr_r', 'cividis',\n 'cividis_r', 'cool', 'cool_r', 'coolwarm', 'coolwarm_r', \n'copper', 'copper_r', 'cubehelix', 'cubehelix_r', 'flag', \n'flag_r', 'gist_earth', 'gist_earth_r', 'gist_gray', \n'gist_gray_r', 'gist_heat', 'gist_heat_r', 'gist_ncar',\n 'gist_ncar_r', 'gist_rainbow', 'gist_rainbow_r', \n'gist_stern', 'gist_stern_r', 'gist_yarg', 'gist_yarg_r',\n 'gnuplot', 'gnuplot2','gnuplot2_r', 'gnuplot_r',\n 'gray', 'gray_r', 'hot', 'hot_r', 'hsv',\n 'hsv_r', 'icefire', 'icefire_r', 'inferno', 'inferno_r', 'jet', \n'jet_r', 'magma', 'magma_r', 'mako', 'mako_r', <\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"seaborns-plotting-functions\"><strong>Seaborn\u2019s plotting functions<\/strong><\/h2>\n\n\n\n<p>In this section, we shall explore some of the wide variety of options you got when using Seaborn for plotting graphs. There are various kinds of plots that are supported in Seaborn and here we are going to explore a few of them.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"plotting-with-the-relplot-function\"><strong>Plotting with the relplot function<\/strong><\/h3>\n\n\n\n<p>The Seaborn library provides us with relplot() function and this function provides access to several different axes-level functions that show the relationship between two variables with semantic mappings of subsets. The kind parameter selects the underlying axes-level function to use:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>scatterplot() (with kind=\"scatter\")<\/li>\n\n\n\n<li>lineplot() (with kind=\"line\")<\/li>\n<\/ul>\n\n\n\n<p>The default value for the parameter kind is \u2018scatter\u2019 which means that by default this function would return a scatterplot. Here are a few examples of this function:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport seaborn as sns\ntips = sns.load_dataset(&quot;tips&quot;)\ntips.head()\n<\/pre><\/div>\n\n<figure class=\"wp-block-image aligncenter size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/14.png\"><img decoding=\"async\" width=\"424\" height=\"187\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/14.png\" alt=\"\" class=\"wp-image-20728\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/14.png 424w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/14-300x132.png 300w\" sizes=\"(max-width: 424px) 100vw, 424px\" \/><\/figure>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; first-line: 4; title: ; notranslate\" title=\"\">\nsns.relplot(data=tips, x=&quot;total_bill&quot;, y=&quot;tip&quot;)\n<\/pre><\/div>\n\n<figure class=\"wp-block-image aligncenter size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/15.png\"><img decoding=\"async\" width=\"348\" height=\"348\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/15.png\" alt=\"\" class=\"wp-image-20730\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/15.png 348w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/15-300x300.png 300w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/15-150x150.png 150w\" sizes=\"(max-width: 348px) 100vw, 348px\" \/><\/figure>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; first-line: 5; title: ; notranslate\" title=\"\">\nsns.relplot(data=tips, x=&quot;total_bill&quot;, y=&quot;tip&quot;, hue=&quot;day&quot;)\n<\/pre><\/div>\n\n<figure class=\"wp-block-image aligncenter size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/16.png\"><img decoding=\"async\" width=\"411\" height=\"348\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/16.png\" alt=\"\" class=\"wp-image-20731\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/16.png 411w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/16-300x254.png 300w\" sizes=\"(max-width: 411px) 100vw, 411px\" \/><figcaption class=\"wp-element-caption\">Using hue parameter<\/figcaption><\/figure>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; first-line: 6; title: ; notranslate\" title=\"\">\nsns.relplot(data=tips, x=&quot;total_bill&quot;, y=&quot;tip&quot;, hue=&quot;sex&quot;, col=&quot;day&quot;, col_wrap=2)\n<\/pre><\/div>\n\n<figure class=\"wp-block-image size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/18.png\"><img decoding=\"async\" width=\"789\" height=\"708\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/18.png\" alt=\"\" class=\"wp-image-20732\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/18.png 789w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/18-300x269.png 300w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/18-768x689.png 768w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/18-696x625.png 696w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/18-468x420.png 468w\" sizes=\"(max-width: 789px) 100vw, 789px\" \/><\/figure>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsns.relplot(data=tips, x=&quot;size&quot;, y=&quot;tip&quot;,kind=&quot;line&quot;,ci=None)\n<\/pre><\/div>\n\n<figure class=\"wp-block-image aligncenter size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/19.png\"><img decoding=\"async\" width=\"352\" height=\"352\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/19.png\" alt=\"\" class=\"wp-image-20733\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/19.png 352w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/19-300x300.png 300w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/19-150x150.png 150w\" sizes=\"(max-width: 352px) 100vw, 352px\" \/><figcaption class=\"wp-element-caption\">Using the kind=line to plot the line plot<\/figcaption><\/figure>\n\n\n\n<p>Now as you can see, we have added an extra dimension to our plot by colouring the points according to a third variable. In seaborn, this is referred to as using a \u201chue semantic\u201d, because the colour of the point gains meaning and it is done by passing the third variable to the hue parameter of the relplot function. We will discuss the col parameter later in the facetGrid section.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"histogram\"><strong>Histogram<\/strong><\/h3>\n\n\n\n<p>Histograms represent the data distribution by forming bins along with the range of the data and then drawing bars to show the number of observations that fall in each bin.In Seaborn we use distplot() function to plot histograms.Here is an example:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport seaborn as sns\nfrom matplotlib import pyplot as plt\ndf = sns.load_dataset(&#039;iris&#039;)\nsns.distplot(df&#x5B;&#039;petal_length&#039;],kde = False)\n<\/pre><\/div>\n\n<figure class=\"wp-block-image aligncenter size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/20.png\"><img decoding=\"async\" width=\"368\" height=\"263\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/20.png\" alt=\"\" class=\"wp-image-20734\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/20.png 368w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/20-300x214.png 300w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/20-100x70.png 100w\" sizes=\"(max-width: 368px) 100vw, 368px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"bar-plot\"><strong>Bar Plot<\/strong><\/h3>\n\n\n\n<p>Seaborn supports many types of bar plots and you will see a few of them here. Here, as mentioned in the introduction we will use both seaborn and matplotlib together to demonstrate several plots.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"vertical-barplot\"><strong>Vertical barplot<\/strong><\/h4>\n\n\n\n<p>The barplot plot below shows the survivors of the titanic crash based on category.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n \nsns.set_context(&#039;paper&#039;)\n\n# load dataset\ntitanic = sns.load_dataset(&#039;titanic&#039;)\n# create plot\nsns.barplot(x = &#039;embark_town&#039;, y = &#039;age&#039;, data = titanic,\n            palette = &#039;PuRd&#039;,ci=None  \n            )\nplt.legend()\nplt.show()\nprint(titanic.columns)\n<\/pre><\/div>\n\n<figure class=\"wp-block-image aligncenter size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/23.png\"><img decoding=\"async\" width=\"382\" height=\"264\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/23.png\" alt=\"\" class=\"wp-image-20737\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/23.png 382w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/23-300x207.png 300w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/23-218x150.png 218w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/23-100x70.png 100w\" sizes=\"(max-width: 382px) 100vw, 382px\" \/><\/figure>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n# load dataset\ntitanic = sns.load_dataset(&#039;titanic&#039;)\n# create plot\nsns.barplot(x = &#039;sex&#039;, y = &#039;survived&#039;, hue = &#039;class&#039;, data = titanic,\n            palette = &#039;PuRd&#039;,\n            order = &#x5B;&#039;male&#039;, &#039;female&#039;],  \n            capsize = 0.05,             \n            saturation = 8,             \n            errcolor = &#039;gray&#039;, errwidth = 2,  \n            ci = &#039;sd&#039;   \n            )\nplt.legend()\nplt.show()\n<\/pre><\/div>\n\n<figure class=\"wp-block-image aligncenter size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/21.png\"><img decoding=\"async\" width=\"392\" height=\"263\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/21.png\" alt=\"\" class=\"wp-image-20735\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/21.png 392w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/21-300x201.png 300w\" sizes=\"(max-width: 392px) 100vw, 392px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"horizontal-barplot\"><strong>Horizontal barplot<\/strong><\/h4>\n\n\n\n<p>To draw a horizontal plot pass \u2018h\u2019 to the parameter, orient of the barplot function as shown below:<br><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n \nsns.set_context(&#039;paper&#039;)\nsns.barplot(x = &#039;age&#039;, y = &#039;embark_town&#039;, data = titanic,\n            palette = &#039;PuRd&#039;, orient = &#039;h&#039;,\n            )\nplt.show()\n<\/pre><\/div>\n\n<figure class=\"wp-block-image aligncenter size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/24.png\"><img decoding=\"async\" width=\"431\" height=\"263\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/24.png\" alt=\"seaborn tutorial\" class=\"wp-image-20738\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/24.png 431w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/24-300x183.png 300w\" sizes=\"(max-width: 431px) 100vw, 431px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"count-plot\"><strong>Count plot<\/strong><\/h3>\n\n\n\n<p>The count plot can be thought of as a histogram across a categorical variable.The example below demonstrates the count plot<br><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport matplotlib.pyplot as plt\nimport seaborn as sns\n \nsns.set_context(&#039;paper&#039;)\n\n# load dataset\ntitanic = sns.load_dataset(&#039;titanic&#039;)\n# create plot\nsns.countplot(x = &#039;class&#039;, hue = &#039;who&#039;, data = titanic, palette = &#039;magma&#039;)\nplt.title(&#039;Survivors&#039;)\nplt.show()\n<\/pre><\/div>\n\n<figure class=\"wp-block-image aligncenter size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/22.png\"><img decoding=\"async\" width=\"388\" height=\"277\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/22.png\" alt=\"seaborn tutorial\" class=\"wp-image-20736\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/22.png 388w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/22-300x214.png 300w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/22-100x70.png 100w\" sizes=\"(max-width: 388px) 100vw, 388px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"point-plot\"><strong>Point Plot<\/strong><\/h3>\n\n\n\n<p>Point plot is used to show point estimates and confidence intervals using scatter plot glyphs. A point plot represents an estimate of central tendency for a numeric variable by the position of scatter plot points and provides some indication of the uncertainty around that estimate using error bars.<\/p>\n\n\n\n<p>Point plots can be more useful than bar plots for focusing comparisons between different levels of one or more categorical variables. Here are a few examples of point plots:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n# importing required packages \nimport seaborn as sns \nimport matplotlib.pyplot as plt \n  \n# loading dataset \ndata = sns.load_dataset(&quot;tips&quot;) \nsns.pointplot(x=&quot;day&quot;, y=&quot;tip&quot;, data=data)\nplt.show()\n<\/pre><\/div>\n\n<figure class=\"wp-block-image aligncenter size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/25.png\"><img decoding=\"async\" width=\"385\" height=\"263\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/25.png\" alt=\"seaborn tutorial\" class=\"wp-image-20739\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/25.png 385w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/25-300x205.png 300w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/25-218x150.png 218w\" sizes=\"(max-width: 385px) 100vw, 385px\" \/><\/figure>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nsns.pointplot(x=&quot;time&quot;, y=&quot;total_bill&quot;, hue=&quot;smoker&quot;,\n                   data=data, palette=&quot;Accent&quot;)\n<\/pre><\/div>\n\n<figure class=\"wp-block-image aligncenter size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/26.png\"><img decoding=\"async\" width=\"383\" height=\"263\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/26.png\" alt=\"\" class=\"wp-image-20740\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/26.png 383w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/26-300x206.png 300w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/26-218x150.png 218w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/26-100x70.png 100w\" sizes=\"(max-width: 383px) 100vw, 383px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"joint-plot\"><strong>Joint Plot<\/strong><br><\/h3>\n\n\n\n<p>Joint Plot draws a plot of two variables with bivariate and univariate graphs. It uses the Scatter Plot and Histogram. Joint Plot can also display data using Kernel Density Estimate (KDE) and Hexagons. We can also draw a Regression Line in Scatter Plot. Here are few of the examples of a joint plot<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nsns.set_style(&quot;dark&quot;)\ntips=sns.load_dataset(&#039;tips&#039;)\nsns.jointplot(x=&#039;total_bill&#039;, y=&#039;tip&#039;,data=tips)\n<\/pre><\/div>\n\n<figure class=\"wp-block-image aligncenter size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/27.png\"><img decoding=\"async\" width=\"421\" height=\"424\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/27.png\" alt=\"seaborn tutorial\" class=\"wp-image-20741\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/27.png 421w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/27-298x300.png 298w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/27-150x150.png 150w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/27-417x420.png 417w\" sizes=\"(max-width: 421px) 100vw, 421px\" \/><\/figure>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; first-line: 6; title: ; notranslate\" title=\"\">\n# Add regression line to scatter plot and kernel density estimate to histogram\nsns.jointplot(x=&#039;total_bill&#039;, y=&#039;tip&#039;, data=tips, kind=&#039;reg&#039;) \n\n\n<\/pre><\/div>\n\n<figure class=\"wp-block-image aligncenter size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/28.png\"><img decoding=\"async\" width=\"421\" height=\"424\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/28.png\" alt=\"seaborn tutorial\" class=\"wp-image-20742\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/28.png 421w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/28-298x300.png 298w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/28-150x150.png 150w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/28-417x420.png 417w\" sizes=\"(max-width: 421px) 100vw, 421px\" \/><\/figure>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; first-line: 8; title: ; notranslate\" title=\"\">\n# Display kernel density estimate instead of scatter plot and histogram\nsns.jointplot(x=&#039;total_bill&#039;, y=&#039;tip&#039;, data=tips, kind=&#039;kde&#039;)\n<\/pre><\/div>\n\n<figure class=\"wp-block-image aligncenter size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/29.png\"><img decoding=\"async\" width=\"421\" height=\"424\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/29.png\" alt=\"\" class=\"wp-image-20743\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/29.png 421w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/29-298x300.png 298w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/29-150x150.png 150w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/29-417x420.png 417w\" sizes=\"(max-width: 421px) 100vw, 421px\" \/><\/figure>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; first-line: 10; title: ; notranslate\" title=\"\">\n# Display hexagons instead of points in scatter plot\nsns.jointplot(x=&#039;total_bill&#039;, y=&#039;tip&#039;, data=tips, kind=&#039;hex&#039;) \n<\/pre><\/div>\n\n<figure class=\"wp-block-image aligncenter size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/30.png\"><img decoding=\"async\" width=\"421\" height=\"424\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/30.png\" alt=\"seaborn tutorial\" class=\"wp-image-20744\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/30.png 421w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/30-298x300.png 298w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/30-150x150.png 150w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/30-417x420.png 417w\" sizes=\"(max-width: 421px) 100vw, 421px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"regplot\"><strong>Regplot<\/strong><\/h3>\n\n\n\n<p>Regplot is one of the functions in Seaborn that are used to visualize the linear relationship as determined through regression. Also, you\u2018ll see a slightly shaded portion around the regression line which indicates how much the pints are scattered around a certain area. Here are few of the examples<\/p>\n\n\n\n<p>Now we will plot a discrete x variable and add some jitter. Here you can see that the areas where points are more densely populated have less shaded portion around the regression line and shaded portion is more spread where the points are more scattered.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport seaborn as sns\ntips = sns.load_dataset(&quot;tips&quot;)\nax = sns.regplot(x=&quot;total_bill&quot;, y=&quot;tip&quot;, data=tips)\n<\/pre><\/div>\n\n<figure class=\"wp-block-image aligncenter size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/32.png\"><img decoding=\"async\" width=\"382\" height=\"264\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/32.png\" alt=\"\" class=\"wp-image-20745\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/32.png 382w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/32-300x207.png 300w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/32-218x150.png 218w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/32-100x70.png 100w\" sizes=\"(max-width: 382px) 100vw, 382px\" \/><\/figure>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nsns.regplot(x=&quot;size&quot;, y=&quot;total_bill&quot;, data=tips, x_jitter=0.1)\n<\/pre><\/div>\n\n<figure class=\"wp-block-image aligncenter size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/33.png\"><img decoding=\"async\" width=\"383\" height=\"263\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/33.png\" alt=\"seaborn tutorial\" class=\"wp-image-20746\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/33.png 383w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/33-300x206.png 300w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/33-218x150.png 218w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/33-100x70.png 100w\" sizes=\"(max-width: 383px) 100vw, 383px\" \/><\/figure>\n\n\n\n<p>We can set the parameter ci=None to get just the line without any highlighted portion.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport seaborn as sns\ntips = sns.load_dataset(&quot;tips&quot;)\nax = sns.regplot(x=&quot;total_bill&quot;, y=&quot;tip&quot;, data=tips,ci=None)\n<\/pre><\/div>\n\n<figure class=\"wp-block-image aligncenter size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/34.png\"><img decoding=\"async\" width=\"382\" height=\"264\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/34.png\" alt=\"\" class=\"wp-image-20747\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/34.png 382w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/34-300x207.png 300w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/34-218x150.png 218w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/34-100x70.png 100w\" sizes=\"(max-width: 382px) 100vw, 382px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"lm-plot\"><strong>Lm Plot<\/strong><\/h3>\n\n\n\n<p>In Seaborn, we can also use lmplot instead of regplot to visualise a regression between two variables as we saw in our last example. But what is the difference between the two plots?<\/p>\n\n\n\n<p>The regplot function performs a simple linear regression model fit and plot whereas the lmplot function combines regplot and FacetGrid.<\/p>\n\n\n\n<p>The FacetGrid class helps in visualizing the distribution of one variable as well as the relationship between multiple variables separately within subsets of your dataset using multiple panels.<\/p>\n\n\n\n<p>It is further important to note that lmplot() is more computationally intensive and is intended as a convenient interface to fit regression models across conditional subsets of a dataset.<\/p>\n\n\n\n<p>Here is a simple example of lmplot where it seems to work just like regplot.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport seaborn as sns\ntips = sns.load_dataset(&quot;tips&quot;)\nsns.lmplot(x=&quot;total_bill&quot;, y=&quot;tip&quot;, data=tips)\n<\/pre><\/div>\n\n<figure class=\"wp-block-image aligncenter size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/35.png\"><img decoding=\"async\" width=\"352\" height=\"352\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/35.png\" alt=\"seaborn tutorial\" class=\"wp-image-20748\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/35.png 352w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/35-300x300.png 300w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/35-150x150.png 150w\" sizes=\"(max-width: 352px) 100vw, 352px\" \/><\/figure>\n\n\n\n<p>Here is how we can use the advance features of lmplot() and use it with multi-plot grid for plotting conditional relationships.<br><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nsns.lmplot(x=&quot;total_bill&quot;, y=&quot;tip&quot;, col=&quot;day&quot;, hue=&quot;day&quot;,\n               data=tips, col_wrap=2, height=3)\n<\/pre><\/div>\n\n<figure class=\"wp-block-image aligncenter size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/36.png\"><img decoding=\"async\" width=\"424\" height=\"424\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/36.png\" alt=\"seaborn tutorial\" class=\"wp-image-20749\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/36.png 424w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/36-300x300.png 300w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/36-150x150.png 150w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/36-420x420.png 420w\" sizes=\"(max-width: 424px) 100vw, 424px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"kde-plot\"><strong>KDE plot<\/strong><\/h3>\n\n\n\n<p>KDE plot is a Kernel Density Estimate that is used for visualizing the Probability Density of the continuous or non-parametric data variables i.e. we can plot for the univariate or multiple variables altogether. Here are few of the examples<br><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nsns.set_style(&quot;dark&quot;)\niris = sns.load_dataset(&quot;iris&quot;)\n# Plotting the KDE Plot \nsns.kdeplot(iris.loc&#x5B;(iris&#x5B;&#039;species&#039;]==&#039;setosa&#039;), \n            &#039;sepal_length&#039;], color=&#039;b&#039;, shade=True, Label=&#039;setosa&#039;) \nsns.kdeplot(iris.loc&#x5B;(iris&#x5B;&#039;species&#039;]==&#039;virginica&#039;), \n            &#039;sepal_length&#039;], color=&#039;r&#039;, shade=True, Label=&#039;virginica&#039;)\n<\/pre><\/div>\n\n<figure class=\"wp-block-image aligncenter size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/37.png\"><img decoding=\"async\" width=\"372\" height=\"248\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/37.png\" alt=\"seaborn tutorial\" class=\"wp-image-20750\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/37.png 372w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/37-300x200.png 300w\" sizes=\"(max-width: 372px) 100vw, 372px\" \/><\/figure>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n# Setting up the samples \niris_setosa = iris.query(&quot;species==&#039;setosa&#039;&quot;) \niris_virginica = iris.query(&quot;species==&#039;virginica&#039;&quot;) \n  \n# Plotting the KDE Plot \nsns.kdeplot(iris_setosa&#x5B;&#039;sepal_length&#039;],  \n            iris_setosa&#x5B;&#039;sepal_width&#039;], \n            color=&#039;r&#039;, shade=True, Label=&#039;Iris_Setosa&#039;, \n            cmap=&quot;Reds&quot;, shade_lowest=False) \n# Plotting the KDE Plot \nsns.kdeplot(iris_virginica&#x5B;&#039;sepal_length&#039;],  \n            iris_virginica&#x5B;&#039;sepal_width&#039;], \n            color=&#039;r&#039;, shade=True, Label=&#039;iris_virginica&#039;, \n            cmap=&quot;Blues&quot;, shade_lowest=False) \n<\/pre><\/div>\n\n<figure class=\"wp-block-image aligncenter size-large is-resized zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/38.png\"><img decoding=\"async\" width=\"387\" height=\"263\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/38.png\" alt=\"\" class=\"wp-image-20751\" style=\"width:413px;height:281px\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/38.png 387w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/38-300x204.png 300w\" sizes=\"(max-width: 387px) 100vw, 387px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"box-plot\"><strong>Box Plot<\/strong><\/h3>\n\n\n\n<p>The box plot, also called the box and whisker diagram is used for depicting groups of numerical data through the quartiles. It is known as the box and whisker diagram because it is composed of a box and whiskers. Boxplot is also used for detecting the outlier in a data set.<\/p>\n\n\n\n<p>A box plot is composed of a summary of 5 different data points: the minimum, first quartile, median, third quartile, and maximum.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Minimum<\/li>\n\n\n\n<li>First Quartile or 25%<\/li>\n\n\n\n<li>Median (Second Quartile) or 50%<\/li>\n\n\n\n<li>Third Quartile or 75%<\/li>\n\n\n\n<li>Maximum<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport seaborn as sns\ntips = sns.load_dataset(&quot;tips&quot;)\nsns.boxplot(x=&quot;day&quot;, y=&quot;total_bill&quot;, data=tips)\n<\/pre><\/div>\n\n<figure class=\"wp-block-image aligncenter size-large is-resized zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/39.png\"><img decoding=\"async\" width=\"383\" height=\"263\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/39.png\" alt=\"seaborn tutorial\" class=\"wp-image-20752\" style=\"width:399px;height:274px\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/39.png 383w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/39-300x206.png 300w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/39-218x150.png 218w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/39-100x70.png 100w\" sizes=\"(max-width: 383px) 100vw, 383px\" \/><\/figure>\n\n\n\n<p>Let me briefly explain the above plot.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The bottom black horizontal line of the box plot is the minimum value<\/li>\n\n\n\n<li>The first black horizontal line of the rectangle shape of the box plot is the first quartile<\/li>\n\n\n\n<li>&nbsp;or 25%<\/li>\n\n\n\n<li>The second black horizontal line of the rectangle shape of the box plot is Second quartile or 50% or median.<\/li>\n\n\n\n<li>The third black horizontal line of rectangle shape of the same box plot is third quartile or 75%<\/li>\n\n\n\n<li>The top black horizontal line of the rectangle shape of the box plot is the maximum value.<\/li>\n\n\n\n<li>The small diamond shape of the box plot is outlier data.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"violin-plot\"><strong>Violin Plot<\/strong><\/h3>\n\n\n\n<p>Violin plots also like boxplots summarize numeric data over a set of categories. They are essentially a box plot with a kernel density estimate (KDE) overlaid along with the range of the box and reflected to make it look nice. Unlike a box plot, in which all of the plot components correspond to actual data points, the violin plot features a kernel density estimation of the underlying distribution. Here are a few examples of violin plot:<br><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport seaborn as sns\ntips = sns.load_dataset(&quot;tips&quot;)\nax = sns.violinplot(x=tips&#x5B;&quot;total_bill&quot;])\n<\/pre><\/div>\n\n<figure class=\"wp-block-image aligncenter size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/40.png\"><img decoding=\"async\" width=\"349\" height=\"263\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/40.png\" alt=\"\" class=\"wp-image-20753\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/40.png 349w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/40-300x226.png 300w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/40-80x60.png 80w\" sizes=\"(max-width: 349px) 100vw, 349px\" \/><\/figure>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nsns.violinplot(x=&quot;day&quot;, y=&quot;total_bill&quot;, hue=&quot;smoker&quot;,\n                    data=tips, palette=&quot;muted&quot;)\n<\/pre><\/div>\n\n<figure class=\"wp-block-image aligncenter size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/41.png\"><img decoding=\"async\" width=\"383\" height=\"262\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/41.png\" alt=\"seaborn tutorial\" class=\"wp-image-20754\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/41.png 383w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/41-300x205.png 300w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/41-218x150.png 218w\" sizes=\"(max-width: 383px) 100vw, 383px\" \/><\/figure>\n\n\n\n<p>Now we can also represent the above plot like this by setting the parameter split as True:<br><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nsns.violinplot(x=&quot;day&quot;, y=&quot;total_bill&quot;, hue=&quot;smoker&quot;,\n                    data=tips, palette=&quot;muted&quot;, split=True)\n<\/pre><\/div>\n\n<figure class=\"wp-block-image aligncenter size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/42.png\"><img decoding=\"async\" width=\"383\" height=\"262\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/42.png\" alt=\"\" class=\"wp-image-20755\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/42.png 383w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/42-300x205.png 300w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/42-218x150.png 218w\" sizes=\"(max-width: 383px) 100vw, 383px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"heatmap\"><strong>Heatmap<\/strong><\/h3>\n\n\n\n<p>A heatmap is a two-dimensional graphical representation of data where the individual values that are contained in a matrix are represented as colours. In Seaborn, we can make annotated heatmaps which can be tweaked using Matplotlib as per requirement.<\/p>\n\n\n\n<p>Now if we get the data of the dataset \u2018flights\u2019 and transform it by monthly as shown below, it can give us a lot of information about the data. But this information is in tabular form and can be better displayed by using heatmap as shown below:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nflights=sns.load_dataset(&quot;flights&quot;)\nflights = flights.pivot(&quot;month&quot;, &quot;year&quot;, &quot;passengers&quot;)\nprint(flights)\n\n<\/pre><\/div>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; gutter: false; title: ; notranslate\" title=\"\">\nOutput:\nyear       1949  1950  1951  1952  1953  ...  1956  1957  1958  1959  1960\nmonth                                    ...                              \nJanuary     112   115   145   171   196  ...   284   315   340   360   417\nFebruary    118   126   150   180   196  ...   277   301   318   342   391\nMarch       132   141   178   193   236  ...   317   356   362   406   419\nApril       129   135   163   181   235  ...   313   348   348   396   461\nMay         121   125   172   183   229  ...   318   355   363   420   472\nJune        135   149   178   218   243  ...   374   422   435   472   535\nJuly        148   170   199   230   264  ...   413   465   491   548   622\nAugust      148   170   199   242   272  ...   405   467   505   559   606\nSeptember   136   158   184   209   237  ...   355   404   404   463   508\nOctober     119   133   162   191   211  ...   306   347   359   407   461\nNovember    104   114   146   172   180  ...   271   305   310   362   390\nDecember    118   140   166   194   201  ...   306   336   337   405   432\n<\/pre><\/div>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nsns.heatmap(flights,linewidths=.5,cmap=&quot;YlGnBu&quot;)\n<\/pre><\/div>\n\n<figure class=\"wp-block-image aligncenter size-large is-resized zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/43.png\"><img decoding=\"async\" width=\"411\" height=\"278\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/43.png\" alt=\"seaborn tutorial\" class=\"wp-image-20756\" style=\"width:445px;height:301px\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/43.png 411w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/43-300x203.png 300w\" sizes=\"(max-width: 411px) 100vw, 411px\" \/><\/figure>\n\n\n\n<p>Now we can also put the respective values in the boxes using the annot parameter of this function<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport seaborn as sns\ncar_crashes = sns.load_dataset(&quot;car_crashes&quot;)\ncorr=car_crashes.corr()\nprint(corr)\nsns.heatmap(corr,annot=True,linewidths=.5,cmap=&quot;YlGnBu&quot;)\n<\/pre><\/div>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; gutter: false; title: ; notranslate\" title=\"\">\nOutput \n                  total  speeding  ...  ins_premium  ins_losses\ntotal           1.000000  0.611548  ...    -0.199702   -0.036011\nspeeding        0.611548  1.000000  ...    -0.077675   -0.065928\nalcohol         0.852613  0.669719  ...    -0.170612   -0.112547\nnot_distracted  0.827560  0.588010  ...    -0.174856   -0.075970\nno_previous     0.956179  0.571976  ...    -0.156895   -0.006359\nins_premium    -0.199702 -0.077675  ...     1.000000    0.623116\nins_losses     -0.036011 -0.065928  ...     0.623116    1.000000\n\n<\/pre><\/div>\n\n<figure class=\"wp-block-image aligncenter size-large is-resized zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/44.png\"><img decoding=\"async\" width=\"403\" height=\"306\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/44.png\" alt=\"seaborn tutorial\" class=\"wp-image-20757\" style=\"width:423px;height:321px\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/44.png 403w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/44-300x228.png 300w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/44-80x60.png 80w\" sizes=\"(max-width: 403px) 100vw, 403px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"cluster-map\"><strong>Cluster map<\/strong><\/h3>\n\n\n\n<p>Cluster map method plots a matrix dataset as a hierarchically-clustered heatmap. It uses hierarchical clusters to order data by similarity. This reorganizes the data for the rows and columns and displays similar content next to one another for even more depth of understanding the data.<br><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport seaborn as sns\nflights=sns.load_dataset(&quot;flights&quot;)\nflights = flights.pivot(&quot;month&quot;, &quot;year&quot;, &quot;passengers&quot;)\nsns.clustermap(flights,linewidths=.5,cmap=&quot;coolwarm&quot;)\n<\/pre><\/div>\n\n<figure class=\"wp-block-image aligncenter size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/45.png\"><img decoding=\"async\" width=\"712\" height=\"712\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/45.png\" alt=\"seaborn tutorial\" class=\"wp-image-20758\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/45.png 712w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/45-300x300.png 300w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/45-150x150.png 150w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/45-696x696.png 696w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/45-420x420.png 420w\" sizes=\"(max-width: 712px) 100vw, 712px\" \/><\/figure>\n\n\n\n<p>As you can see in this map all the columns and rows that have similar data together and now neither the years nor the months are in order as we saw in the heatmap. We can modify it a bit and only cluster rows or columns, here is how :<br><\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport seaborn as sns\nflights=sns.load_dataset(&quot;flights&quot;)\nflights = flights.pivot(&quot;month&quot;, &quot;year&quot;, &quot;passengers&quot;)\nsns.clustermap(flights,linewidths=.5,cmap=&quot;coolwarm&quot;,col_cluster=False)\n<\/pre><\/div>\n\n<figure class=\"wp-block-image size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/46.png\"><img decoding=\"async\" width=\"712\" height=\"712\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/46.png\" alt=\"seaborn tutorial\" class=\"wp-image-20759\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/46.png 712w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/46-300x300.png 300w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/46-150x150.png 150w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/46-696x696.png 696w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/46-420x420.png 420w\" sizes=\"(max-width: 712px) 100vw, 712px\" \/><\/figure>\n\n\n\n<p>Now all the years are in order but the months are clustered and thus are not in order<br><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"facetgrid\"><strong>Facetgrid<\/strong><\/h3>\n\n\n\n<p>Facet grid forms a matrix of panels defined by row and column by dividing the variables. Due to panels, a single plot looks like multiple plots. It is very helpful to analyze all combinations in two discrete variables.<br><\/p>\n\n\n\n<p>The advantage of using Facet is, we can input another variable into the plot. The above plot is divided into two plots based on a third variable called \u2018diet\u2019 using the \u2018col\u2019 parameter. We can also one more parameter \u201crow\u201d which can help to add one more variable to our plot. Now the plot below shows that relation between tips and total bill and also show their relation with two more variables,i.e gender and time.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport seaborn as sns\ntips = sns.load_dataset(&quot;tips&quot;)\ng = sns.FacetGrid(tips, col=&quot;time&quot;)\ng.map(sns.scatterplot, &quot;total_bill&quot;, &quot;tip&quot;)\n<\/pre><\/div>\n\n<figure class=\"wp-block-image aligncenter size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/47.png\"><img decoding=\"async\" width=\"424\" height=\"208\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/47.png\" alt=\"\" class=\"wp-image-20760\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/47.png 424w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/47-300x147.png 300w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/47-324x160.png 324w\" sizes=\"(max-width: 424px) 100vw, 424px\" \/><\/figure>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\ntips = sns.load_dataset(&quot;tips&quot;)\ng = sns.FacetGrid(tips, col=&quot;time&quot;, row=&quot;sex&quot;)\ng.map(sns.scatterplot, &quot;total_bill&quot;, &quot;tip&quot;)\n<\/pre><\/div>\n\n<figure class=\"wp-block-image aligncenter size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/48.png\"><img decoding=\"async\" width=\"424\" height=\"424\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/48.png\" alt=\"seaborn tutorial\" class=\"wp-image-20761\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/48.png 424w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/48-300x300.png 300w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/48-150x150.png 150w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/48-420x420.png 420w\" sizes=\"(max-width: 424px) 100vw, 424px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"pair-plot\"><strong>Pair Plot<\/strong><\/h3>\n\n\n\n<p>Pair plot creates a grid of Axes such that each numeric variable in data will be shared across the y-axes across a single row and the x-axes across a single column. The diagonal plots are treated differently: a univariate distribution plot is drawn to show the marginal distribution of the data in each column.<\/p>\n\n\n\n<p>Pair Plots are a really simple way to visualize relationships between each variable. It produces a matrix of relationships between each variable in your data for an instant examination of our data as you'll see in the example below.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport seaborn as sns\nfrom matplotlib import pyplot as plt\ndf = sns.load_dataset(&#039;iris&#039;)\nsns.set_style(&quot;ticks&quot;)\nsns.pairplot(df,hue = &#039;species&#039;,diag_kind = &quot;kde&quot;,kind = &quot;scatter&quot;,palette = &quot;husl&quot;)\nplt.show()\n<\/pre><\/div>\n\n<figure class=\"wp-block-image size-large zoomable\" data-full=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/49.png\"><img decoding=\"async\" width=\"800\" height=\"731\" src=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/49.png\" alt=\"seaborn tutorial\" class=\"wp-image-20762\" srcset=\"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/49.png 800w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/49-300x274.png 300w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/49-768x702.png 768w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/49-696x636.png 696w, https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/49-460x420.png 460w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p>This brings us to the end of this article where we covered some basics of Seaborn and learned to plot various plots. You can get a free course on Machine learning on great learning academy, click the banner below to know more.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"further-reading\">Further reading<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.mygreatlearning.com\/blog\/what-is-machine-learning\/\">What is Machine Learning?<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.mygreatlearning.com\/blog\/matplotlib-tutorial-for-data-visualisation\/\">Introduction to Matplotlib<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.mygreatlearning.com\/blog\/what-is-data-visualization\/\">Introduction to Data Visualisation- Why is it Important?<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.mygreatlearning.com\/blog\/what-is-data-science\/\">What is Data Science?<\/a><\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Seaborn is an amazing data visualization library for statistical graphics plotting in Python. It provides beautiful default styles and colour palettes to make statistical plots more attractive. It is built on the top of the matplotlib library and also closely integrated to the data structures from pandas. In this tutorial, we shall see how to [&hellip;]<\/p>\n","protected":false},"author":41,"featured_media":20769,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[9],"tags":[36797,36796],"content_type":[],"class_list":["post-20709","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-data-science","tag-data-visualization","tag-python"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Seaborn Tutorial in Python for beginners | Data Visualization using Seaborn<\/title>\n<meta name=\"description\" content=\"Seaborn Tutorial: In this Seaborn Tutorial you will see various plots that are supported by this library and learn to make your plots attractive. Read the full post to know more.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.mygreatlearning.com\/blog\/seaborn-tutorial\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Seaborn Tutorial in Python For Beginners\" \/>\n<meta property=\"og:description\" content=\"Seaborn Tutorial: In this Seaborn Tutorial you will see various plots that are supported by this library and learn to make your plots attractive. Read the full post to know more.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.mygreatlearning.com\/blog\/seaborn-tutorial\/\" \/>\n<meta property=\"og:site_name\" content=\"Great Learning Blog: Free Resources what Matters to shape your Career!\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/GreatLearningOfficial\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-07-26T07:51:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-09-02T09:54:28+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/shutterstock_1062210707.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1000\" \/>\n\t<meta property=\"og:image:height\" content=\"668\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Great Learning Editorial Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/Great_Learning\" \/>\n<meta name=\"twitter:site\" content=\"@Great_Learning\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Great Learning Editorial Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"21 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/seaborn-tutorial\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/seaborn-tutorial\\\/\"},\"author\":{\"name\":\"Great Learning Editorial Team\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/person\\\/6f993d1be4c584a335951e836f2656ad\"},\"headline\":\"Seaborn Tutorial in Python For Beginners\",\"datePublished\":\"2021-07-26T07:51:00+00:00\",\"dateModified\":\"2024-09-02T09:54:28+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/seaborn-tutorial\\\/\"},\"wordCount\":2455,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/seaborn-tutorial\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/09\\\/shutterstock_1062210707.jpg\",\"keywords\":[\"Data Visualization\",\"python\"],\"articleSection\":[\"Data Science and Analytics\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/seaborn-tutorial\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/seaborn-tutorial\\\/\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/seaborn-tutorial\\\/\",\"name\":\"Seaborn Tutorial in Python for beginners | Data Visualization using Seaborn\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/seaborn-tutorial\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/seaborn-tutorial\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/09\\\/shutterstock_1062210707.jpg\",\"datePublished\":\"2021-07-26T07:51:00+00:00\",\"dateModified\":\"2024-09-02T09:54:28+00:00\",\"description\":\"Seaborn Tutorial: In this Seaborn Tutorial you will see various plots that are supported by this library and learn to make your plots attractive. Read the full post to know more.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/seaborn-tutorial\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/seaborn-tutorial\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/seaborn-tutorial\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/09\\\/shutterstock_1062210707.jpg\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2020\\\/09\\\/shutterstock_1062210707.jpg\",\"width\":1000,\"height\":668,\"caption\":\"seaborn tutorial\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/seaborn-tutorial\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Data Science and Analytics\",\"item\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/data-science\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Seaborn Tutorial in Python For Beginners\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\",\"name\":\"Great Learning Blog\",\"description\":\"Learn, Upskill &amp; Career Development Guide and Resources\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\"},\"alternateName\":\"Great Learning\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#organization\",\"name\":\"Great Learning\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/GL-Logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/GL-Logo.jpg\",\"width\":900,\"height\":900,\"caption\":\"Great Learning\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/GreatLearningOfficial\\\/\",\"https:\\\/\\\/x.com\\\/Great_Learning\",\"https:\\\/\\\/www.instagram.com\\\/greatlearningofficial\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/school\\\/great-learning\\\/\",\"https:\\\/\\\/in.pinterest.com\\\/greatlearning12\\\/\",\"https:\\\/\\\/www.youtube.com\\\/user\\\/beaconelearning\\\/\"],\"description\":\"Great Learning is a leading global ed-tech company for professional training and higher education. It offers comprehensive, industry-relevant, hands-on learning programs across various business, technology, and interdisciplinary domains driving the digital economy. These programs are developed and offered in collaboration with the world's foremost academic institutions.\",\"email\":\"info@mygreatlearning.com\",\"legalName\":\"Great Learning Education Services Pvt. Ltd\",\"foundingDate\":\"2013-11-29\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"1001\",\"maxValue\":\"5000\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/#\\\/schema\\\/person\\\/6f993d1be4c584a335951e836f2656ad\",\"name\":\"Great Learning Editorial Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"contentUrl\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/unnamed.webp\",\"caption\":\"Great Learning Editorial Team\"},\"description\":\"The Great Learning Editorial Staff includes a dynamic team of subject matter experts, instructors, and education professionals who combine their deep industry knowledge with innovative teaching methods. Their mission is to provide learners with the skills and insights needed to excel in their careers, whether through upskilling, reskilling, or transitioning into new fields.\",\"sameAs\":[\"https:\\\/\\\/www.mygreatlearning.com\\\/\",\"https:\\\/\\\/in.linkedin.com\\\/school\\\/great-learning\\\/\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/Great_Learning\",\"https:\\\/\\\/www.youtube.com\\\/channel\\\/UCObs0kLIrDjX2LLSybqNaEA\"],\"award\":[\"Best EdTech Company of the Year 2024\",\"Education Economictimes Outstanding Education\\\/Edtech Solution Provider of the Year 2024\",\"Leading E-learning Platform 2024\"],\"url\":\"https:\\\/\\\/www.mygreatlearning.com\\\/blog\\\/author\\\/greatlearning\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Seaborn Tutorial in Python for beginners | Data Visualization using Seaborn","description":"Seaborn Tutorial: In this Seaborn Tutorial you will see various plots that are supported by this library and learn to make your plots attractive. Read the full post to know more.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.mygreatlearning.com\/blog\/seaborn-tutorial\/","og_locale":"en_US","og_type":"article","og_title":"Seaborn Tutorial in Python For Beginners","og_description":"Seaborn Tutorial: In this Seaborn Tutorial you will see various plots that are supported by this library and learn to make your plots attractive. Read the full post to know more.","og_url":"https:\/\/www.mygreatlearning.com\/blog\/seaborn-tutorial\/","og_site_name":"Great Learning Blog: Free Resources what Matters to shape your Career!","article_publisher":"https:\/\/www.facebook.com\/GreatLearningOfficial\/","article_published_time":"2021-07-26T07:51:00+00:00","article_modified_time":"2024-09-02T09:54:28+00:00","og_image":[{"width":1000,"height":668,"url":"http:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/shutterstock_1062210707.jpg","type":"image\/jpeg"}],"author":"Great Learning Editorial Team","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/Great_Learning","twitter_site":"@Great_Learning","twitter_misc":{"Written by":"Great Learning Editorial Team","Est. reading time":"21 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.mygreatlearning.com\/blog\/seaborn-tutorial\/#article","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/seaborn-tutorial\/"},"author":{"name":"Great Learning Editorial Team","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/person\/6f993d1be4c584a335951e836f2656ad"},"headline":"Seaborn Tutorial in Python For Beginners","datePublished":"2021-07-26T07:51:00+00:00","dateModified":"2024-09-02T09:54:28+00:00","mainEntityOfPage":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/seaborn-tutorial\/"},"wordCount":2455,"commentCount":0,"publisher":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/seaborn-tutorial\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/shutterstock_1062210707.jpg","keywords":["Data Visualization","python"],"articleSection":["Data Science and Analytics"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.mygreatlearning.com\/blog\/seaborn-tutorial\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.mygreatlearning.com\/blog\/seaborn-tutorial\/","url":"https:\/\/www.mygreatlearning.com\/blog\/seaborn-tutorial\/","name":"Seaborn Tutorial in Python for beginners | Data Visualization using Seaborn","isPartOf":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/seaborn-tutorial\/#primaryimage"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/seaborn-tutorial\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/shutterstock_1062210707.jpg","datePublished":"2021-07-26T07:51:00+00:00","dateModified":"2024-09-02T09:54:28+00:00","description":"Seaborn Tutorial: In this Seaborn Tutorial you will see various plots that are supported by this library and learn to make your plots attractive. Read the full post to know more.","breadcrumb":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/seaborn-tutorial\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.mygreatlearning.com\/blog\/seaborn-tutorial\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/seaborn-tutorial\/#primaryimage","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/shutterstock_1062210707.jpg","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/shutterstock_1062210707.jpg","width":1000,"height":668,"caption":"seaborn tutorial"},{"@type":"BreadcrumbList","@id":"https:\/\/www.mygreatlearning.com\/blog\/seaborn-tutorial\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/www.mygreatlearning.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Data Science and Analytics","item":"https:\/\/www.mygreatlearning.com\/blog\/data-science\/"},{"@type":"ListItem","position":3,"name":"Seaborn Tutorial in Python For Beginners"}]},{"@type":"WebSite","@id":"https:\/\/www.mygreatlearning.com\/blog\/#website","url":"https:\/\/www.mygreatlearning.com\/blog\/","name":"Great Learning Blog","description":"Learn, Upskill &amp; Career Development Guide and Resources","publisher":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization"},"alternateName":"Great Learning","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.mygreatlearning.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.mygreatlearning.com\/blog\/#organization","name":"Great Learning","url":"https:\/\/www.mygreatlearning.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/GL-Logo.jpg","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/06\/GL-Logo.jpg","width":900,"height":900,"caption":"Great Learning"},"image":{"@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/GreatLearningOfficial\/","https:\/\/x.com\/Great_Learning","https:\/\/www.instagram.com\/greatlearningofficial\/","https:\/\/www.linkedin.com\/school\/great-learning\/","https:\/\/in.pinterest.com\/greatlearning12\/","https:\/\/www.youtube.com\/user\/beaconelearning\/"],"description":"Great Learning is a leading global ed-tech company for professional training and higher education. It offers comprehensive, industry-relevant, hands-on learning programs across various business, technology, and interdisciplinary domains driving the digital economy. These programs are developed and offered in collaboration with the world's foremost academic institutions.","email":"info@mygreatlearning.com","legalName":"Great Learning Education Services Pvt. Ltd","foundingDate":"2013-11-29","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"1001","maxValue":"5000"}},{"@type":"Person","@id":"https:\/\/www.mygreatlearning.com\/blog\/#\/schema\/person\/6f993d1be4c584a335951e836f2656ad","name":"Great Learning Editorial Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","url":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","contentUrl":"https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2022\/02\/unnamed.webp","caption":"Great Learning Editorial Team"},"description":"The Great Learning Editorial Staff includes a dynamic team of subject matter experts, instructors, and education professionals who combine their deep industry knowledge with innovative teaching methods. Their mission is to provide learners with the skills and insights needed to excel in their careers, whether through upskilling, reskilling, or transitioning into new fields.","sameAs":["https:\/\/www.mygreatlearning.com\/","https:\/\/in.linkedin.com\/school\/great-learning\/","https:\/\/x.com\/https:\/\/twitter.com\/Great_Learning","https:\/\/www.youtube.com\/channel\/UCObs0kLIrDjX2LLSybqNaEA"],"award":["Best EdTech Company of the Year 2024","Education Economictimes Outstanding Education\/Edtech Solution Provider of the Year 2024","Leading E-learning Platform 2024"],"url":"https:\/\/www.mygreatlearning.com\/blog\/author\/greatlearning\/"}]}},"uagb_featured_image_src":{"full":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/shutterstock_1062210707.jpg",1000,668,false],"thumbnail":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/shutterstock_1062210707-150x150.jpg",150,150,true],"medium":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/shutterstock_1062210707-300x200.jpg",300,200,true],"medium_large":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/shutterstock_1062210707-768x513.jpg",768,513,true],"large":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/shutterstock_1062210707.jpg",1000,668,false],"1536x1536":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/shutterstock_1062210707.jpg",1000,668,false],"2048x2048":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/shutterstock_1062210707.jpg",1000,668,false],"web-stories-poster-portrait":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/shutterstock_1062210707.jpg",640,428,false],"web-stories-publisher-logo":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/shutterstock_1062210707.jpg",96,64,false],"web-stories-thumbnail":["https:\/\/www.mygreatlearning.com\/blog\/wp-content\/uploads\/2020\/09\/shutterstock_1062210707.jpg",150,100,false]},"uagb_author_info":{"display_name":"Great Learning Editorial Team","author_link":"https:\/\/www.mygreatlearning.com\/blog\/author\/greatlearning\/"},"uagb_comment_info":1,"uagb_excerpt":"Seaborn is an amazing data visualization library for statistical graphics plotting in Python. It provides beautiful default styles and colour palettes to make statistical plots more attractive. It is built on the top of the matplotlib library and also closely integrated to the data structures from pandas. In this tutorial, we shall see how to&hellip;","_links":{"self":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/20709","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/comments?post=20709"}],"version-history":[{"count":34,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/20709\/revisions"}],"predecessor-version":[{"id":115332,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/posts\/20709\/revisions\/115332"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/media\/20769"}],"wp:attachment":[{"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/media?parent=20709"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/categories?post=20709"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/tags?post=20709"},{"taxonomy":"content_type","embeddable":true,"href":"https:\/\/www.mygreatlearning.com\/blog\/wp-json\/wp\/v2\/content_type?post=20709"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}