matplotlib
matplotlib
Dataset: score.csv
# line plot
import matplotlib.pyplot as plt
import pandas as pd
plt.plot(x, y, color='orange')
plt.show()
x = data['marks']
y = data['rank']
plt.xlabel('marks', color='red')
plt.ylabel('rank', color='red')
plt.title('MARKS VS RANKS', color='green')
plt.show()
# bar graph
import matplotlib.pyplot as plt
import pandas as pd
x = data['marks']
y = data['rank']
plt.xlabel('marks', color='red')
plt.ylabel('rank', color='red')
plt.title('MARKS VS RANKS', color='green')
plt.xlim(700, 1000)
plt.ylim(2000, 2100)
plt.show()
# pie chart
import matplotlib.pyplot as plt
import pandas as pd
x = data['marks']
plt.show()
# sub plots
import matplotlib.pyplot as plt
import pandas as pd
x = data['marks']
y = data['rank']
z = data['admit']
fig = plt.figure()
# highest marks
x = max(x)
# lowest rank
y = min(y)
print(x,y,z)
plt.show()
# histogram
import matplotlib.pyplot as plt
emp_ages = [22,45,30,60,60,56,60,45,43,43,50,40,34,33,25,19]
bins = [0,10,20,30,40,50,60,70]
plt.xlabel('employee ages')
plt.ylabel('No. of employees')
plt.title('MICROSOFT INC.')
plt.show()