Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # coding: utf-8
- # In[85]:
- import pandas as pd
- import matplotlib.pyplot as plt
- import numpy as np
- import seaborn as sns
- # In[86]:
- d1 = np.random.normal(100,10,200)
- d2 = np.random.normal(90,20,200)
- d3 = np.random.normal(80,30,200)
- d4 = np.random.normal(70,40,200)
- data = [d1,d2,d3,d4]
- # In[87]:
- fig = plt.figure(figsize=(5,3))
- ax = fig.add_axes([0,0,1,1])
- bp = ax.boxplot(data,vert=False)
- plt.show()
- # In[88]:
- x = np.random.normal(10,100,20)
- y = np.random.normal(20,90,20)
- plt.scatter(x,y)
- plt.show()
- # In[89]:
- arr = np.random.normal(10,100,20)
- fig,ax = plt.subplots(figsize=(7,4))
- ax.hist(arr,bins=[25,50,75,100])
- plt.show()
- # In[90]:
- data = {'Maths':90,'Physics':85,'Chemistry':95,'English':100}
- subjects = list(data.keys())
- marks = list(data.values())
- fig = plt.figure(figsize=(7,4))
- plt.bar(subjects,marks,color='silver',width=0.4)
- plt.xlabel("Subjects")
- plt.ylabel("Marks")
- plt.show()
- # In[91]:
- name = ['Alice', 'Bob', 'Charlie', 'Diana', 'Ethan', 'Fiona', 'George']
- age = [12, 23, 15, 18, 9, 14, 9]
- fig = plt.figure(figsize=(8,5))
- plt.pie(age,labels=name)
- plt.show()
- # In[92]:
- data = np.random.randint(low=1,high=100,size=(7,7))
- sns.heatmap(data,cmap='Greens',annot=True)
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement