Python Data visualization 1
Python Data visualization 1
-Python
What is data visualization?
Data visualization isthe representation of data through use of common
●
see effects.
Data visualization is a critical step in the data science process, helping teams
●
and individuals convey data more effectively to colleagues and decision makers.
●Teams that manage reporting systems typically leverage defined template
views to monitor performance.
What is Matplotlib?
Matplotlib is a python package used for 2D graphics.
●
LINE GRAPH
●
SCATTER PLOT
●
Pie Charts
Line Chart
Histogram or Bar Graph
Scatter Plot
LINE GRAPH:
from matplotlib import pyplot as plt
plt.plot([5,3,1],[2,7,1])
plt.show()
Line Chart
import numpy as np
●
plt.show()
●
Bar graph:
from matplotlib import pyplot as plt
x1=[5,8,10]
y1=[12,16,6]
x2=[6,9,11]
y2=[6,15,7]
plt.bar(x1,y1,color='g')
plt.bar(x2,y2,color='r')
plt.title("info")
plt.ylabel("Y AXIS")
plt.xlabel("X AXIS")
HISTOGRAM:
from matplotlib import pyplot as plt
age=[5,8,22,21,20,22,43,67,89,45,25]
bin=[0,10,20,30,40,50,60,70,80,90,100]
plt.hist(age,bin,histtype='bar',rwidth=10)
plt.title("histogram")
plt.ylabel("Y AXIS")
plt.xlabel("X AXIS")
plt.legend()
SCATTER PLOT
import numpy as np
●
x = np.array([5,7,8,7,2,17,2,9,4,11,12,9,6])
●
y = np.array([99,86,87,88,111,86,103,87,94,78,77,85,86])
●
plt.scatter(x, y)
●
x = np.array([2,2,8,1,15,8,12,9,7,3,11,4,7,14,12])
●
y = np.array([100,105,84,105,90,99,90,95,94,100,79,112,91,80,85])
●
plt.scatter(x, y)
●