Foundation of Data Science: Unit V: Data Visualization

Visualization with Seaborn

Matplotlib | Data Visualization

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

Visualization with Seaborn

• Seaborn is a Python data visualization library based on Matplotlib. It provides a high-level interface for drawing attractive and informative statistical graphics. Seaborn is an open- source Python library.

• Seaborn helps you explore and understand your data. Its plotting functions operate on dataframes and arrays containing whole datasets and internally perform the necessary semantic mapping and statistical aggregation to produce informative plots.

• Its dataset-oriented, declarative API. User should focus on what the different elements of your plots mean, rather than on the details of how to draw them.

• Keys features:

a) Seaborn is a statistical plotting library

b) It has beautiful default styles

c) It also is designed to work very well with Pandas dataframe objects.

Seaborn works easily with dataframes and the Pandas library. The graphs created can also be customized easily.

• Functionality that seaborn offers:

a) A dataset-oriented API for examining relationships between multiple variables

b) Convenient views onto the overall structure of complex datasets

c) Specialized support for using categorical variables to show observations or aggregate statistics

d) Options for visualizing univariate or bivariate distributions and for comparing them between subsets of data

e) Automatic estimation and plotting of linear regression models for different kinds of dependent variables

f) High-level abstractions for structuring multi-plot grids that let you easily build complex visualizations

g) Concise control over matplotlib figure styling with several built-in themes

h) Tools for choosing color palettes that faithfully reveal patterns in your data.

Plot a Scatter Plot in Seaborn :

      importmatplotlib.pyplot as plt

      importseaborn as sns

      import pandas as pd

     df = pd.read_csv('worldHappiness2016.csv').

     sns.scatterplot(data= df, x = "Economy (GDP per Capita)", y =

plt.show()

Output:

Difference between Matplotlib and Seaborn


Foundation of Data Science: Unit V: Data Visualization : Tag: : Matplotlib | Data Visualization - Visualization with Seaborn