In [1]:
import numpy as np
import matplotlib.pyplot as plt
In [2]:
x = np.linspace(0, 9, 10)
x
Out[2]:
In [3]:
y = np.linspace(0, 9, 10)
y
Out[3]:
In [4]:
plt.plot(x, y)
plt.show()
In [5]:
x = np.linspace(0, 20, 6)
y = [1, 5, 6, 4, 9, 6]
In [6]:
plt.plot(x, y)
plt.show()
In [7]:
ages = np.array([5, 25, 45, 20, 15])
names = ['Soham', 'Akshit', 'John', 'Kritika', 'Aishwarya']
In [8]:
x
Out[8]:
In [9]:
4
Out[9]:
In [10]:
plt.bar(names, ages)
plt.show()
In [11]:
ages = [5, 25, 45, 20, 15]
names = ['Soham', 'Akshit', 'John', 'Kritika', 'Aishwarya']
In [12]:
plt.bar(names, ages)
plt.show()
In [16]:
plt.barh(names, ages)
plt.show()
In [17]:
plt.bar(names, ages, color = "red")
plt.show()
In [13]:
ages = [5, 25, 45, 20, 15]
In [14]:
plt.pie(ages)
plt.show()
In [15]:
names = ['Soham', 'Akshit', 'John', 'Kritika', 'Aishwarya']
plt.pie(ages, labels = names)
plt.show()