Data Visualization using python libraries | matplotlib I Seaborn | plotly with examples

Published: 22 March 2020
on channel: jaganinfo
790
15

Learn how to create stunning and insightful data visualizations using Python libraries like Matplotlib, Seaborn, and Plotly! 📊✨ This video walks you through the basics and advanced techniques to transform raw data into meaningful charts, graphs, and interactive plots. Perfect for data analysts, scientists, and enthusiasts looking to present data effectively. Unlock the power of Python for data visualization and make your data tell a story! 🚀🐍 #DataScience #Python #dataviz

Visualization is any technique for creating images, diagrams, or animations to communicate a message.
Types of Data Visualizations :
Explanatory:
Exploratory:
#jaganinfo
Python Visualisation Libraries
• Matplotlib
o https://matplotlib.org/
• Pandas built-in plotting
• ggpy
o https://github.com/yhat/ggpy
• Altair
o https://altair-viz.github.io/
• Seaborn
o https://seaborn.pydata.org/
• Plotly
o https://plot.ly/python/
• Bokeh
o https://bokeh.pydata.org/en/latest/
• HoloViews
o http://holoviews.org/
• VisPy
o http://vispy.org/
• Lightning
o http://lightning-viz.org/

Visualization methods :
Distribution
It is commonly used at the initial stage of data exploration i.e. when we get started with understanding the variable. Variables are of two types: Continuous and Categorical. For continuous variable, we look at the center, spread, outlier. For categorical variable we look at frequency table.
Histogram : It is used for showing the distribution of continuous variables.
Box-Plot : It is used to display full range of variation from min to max and useful to identify outlier values.
Comparison
It is used to compare values across different categories.
Common charts to represent these information are Bar and Line chart.
Bar Chart : It is used to compare values across different categories
Line Chart : It is used to compare values over quantitative variable
Composition
It is used to show distribution of a variable across categories of another variable
Pie Chart : It can be created by passing the values representing each of the slices of the pie.
Relationship
It is widely used to understand the correlation between two or more continuous variables
Scatter Plot : It clearly shows the relationship between two variables

Demo 1 : Basic Plot
import matplotlib.pyplot as plt
plt.plot([1,2,4],[5,7,4])
plt.show()

Demo 2 : Basic Plot Legend Title Labels
import matplotlib.pyplot as plt
x,y = [1,2,4],[5,7,4]
x2,y2 = [1,2,5],[8,11,5]
plt.plot(x,y, label = "Firstline")
plt.plot(x2,y2, label = "Secondline")
plt.xlabel('X-axis label')
plt.ylabel('Y-axis label')
plt.title('Graph Title')
plt.legend()
plt.show()

Demo 3 : Bar Chart
import matplotlib.pyplot as plt
x = [2,4,6,8,10]
y = [6,7,8,2,4]
x2 = [1,3,5,7,9]
y2 = [7,8,2,4,2]
plt.bar(x, y, label="FirstBar", color='lightblue')
plt.bar(x2, y2, label="SecondBar", color='c')
plt.xlabel('Bar Number')
plt.ylabel('Bar Height')
plt.title('Graph: Two Bars')
plt.legend()
plt.show()

Demo 4 : Hist Chart
import matplotlib.pyplot as plt
population_ages = [22,55,62,45,21,22,34,42,42,4,99,102,110,120,122,130,111,151,115,112,80,75,65,54,44,42,48]
bins = [0,10,20,30,40,50,60,70,80,90,100,120]
plt.hist(population_ages, bins , histtype='bar', rwidth=0.8)
plt.xlabel('X-axis')
plt.ylabel('Y-axis')
plt.title('Graph: Hist Chart')
plt.legend()
plt.show()

Demo 5 : Scatter Plot
import matplotlib.pyplot as plt
x = [1,2,3,4,5,6,7,8]
y = [5,2,4,2,1,4,5,2]
plt.scatter(x,y,label='skitcat', color='r',s=250)
google matplotlib marker option
plt.scatter(x,y,label='skitcat', color='r',s=200, marker = '*')
plt.xlabel('X-axis')
plt.ylabel('Y-axis')
plt.title('Graph: Scatter Plot')
plt.show()

Demo 6 : Stack Plot
import matplotlib.pyplot as plt
days = [1,2,3,4,5]
sleeping = [7,8,6,11,7]
eating = [2,3,4,3,2]
working = [7,8,7,2,2]
playing = [8,5,7,8,13]
plt.plot([],[],color = 'm',label = 'sleeping')
plt.plot([],[],color = 'c',label = 'eating')
plt.plot([],[],color = 'r',label = 'working')
plt.plot([],[],color = 'y',label = 'playing') # linewidth
plt.stackplot(days,sleeping,eating,working,playing ,colors =['m','c','r','y'])
plt.xlabel('X-axis')
plt.ylabel('Y-axis')
plt.legend()
plt.title('Graph: Stack Plot')
plt.show()
Tags:
NPTEL Data Science Course

Data Science Proctored Videos

Data Analyst Tutorials

Data Engineer Training Videos

Learn Data Science Online

NPTEL Data Science Lectures

Data Science for Beginners

Advanced Data Science Videos

Data Science Certification Course

Free Data Science Resources

Data Science Career Guide

Data Analysis Techniques

Data Engineering Skills

NPTEL Online Learning

Data Science Practical Training


On this page of the site you can watch the video online Data Visualization using python libraries | matplotlib I Seaborn | plotly with examples with a duration of hours minute second in good quality, which was uploaded by the user jaganinfo 22 March 2020, share the link with friends and acquaintances, this video has already been watched 790 times on youtube and it was liked by 15 viewers. Enjoy your viewing!