Data Visualization using Seaborn
Line Plot in Jupyter Notebook
A line plot shows data points connected by lines, it helps visualize changes, patterns, and fluctuations in data, line plot is useful for tracing patterns in data. We will use seaborn library to plot the line chart or line plot.
Follow the below steps to use line chart in you Jupyter Notebook:
- import the seaborn module
- Load the data set using load_dataset() method
- Use lineplot() method to plot the graph line chart
Example:
Python3
# importing packages import seaborn as sns # loading dataset data = sns.load_dataset( "iris" ) # draw lineplot sns.lineplot(x = "sepal_length" , y = "sepal_width" , data = data) |
Output:
Scatter Graph in Jupyter Notebook
A scatter graph represents data points as individual dots on a 2D plane. It’s used to show the relationship or correlation between two variables. We will use seaborn library to plot scatter graph.
Follow the below steps to use scatter graph in you Jupyter Notebook:
- import the seaborn module
- Load the data set using load_dataset() method
- Use scatterplot() method to plot the scatter graph
Example:
Python3
import seaborn data = seaborn.load_dataset( "iris" ) seaborn.scatterplot(data = data) |
Output:
Data Visualization in jupyter notebook
In this article, we will learn how to visualize data in Jupyter Notebook there are different libraries available in Python for data visualization like Matplotlib, seaborn, Plotly, GGPlot, Bokeh, etc. But in this article, we will use different libraries like Matplotlib, searborn, and Plotly which are widely used for data visualization. We will generate different graphs and plots in Jupyter Notebook using these libraries such as bar graphs, pie charts, line charts, scatter graphs, histograms, and box plots. We will also discuss how to install these libraries and use examples to understand each graph.
Jupyter Notebook
The Jupyter Notebook is the original web application for creating and sharing computational documents that contain live code, equations, visualizations, and narrative text. It offers a simple, streamlined, document-centric experience. Jupyter has support for over 40 different programming languages and Python is one of them.
Prerequisites
In this article, we will use different libraries to create graphs and plots and you have to install the library to function the below example you can use the following code snippetes to install the dependencies.
Install matplotlib
pip install matplotlib
Install Seaborn
pip install seaborn
Install Plotly
pip install plotly