1from matplotlib import pyplot as plt
2plt.plot([0, 1, 2, 3, 4, 5], [0, 1, 4, 9, 16, 25])
3plt.show()
1from matplotlib import pyplot as plt
2
3# Median Developer Salaries by Age
4dev_x = [25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35]
5
6dev_y = [38496, 42000, 46752, 49320, 53200,
7 56000, 62316, 64928, 67317, 68748, 73752]
8
9plt.plot(dev_x, dev_y)
10plt.xlabel('Ages')
11plt.ylabel('Median Salary (USD)')
12plt.title('Median Salary (USD) by Age')
13plt.show()
14
15#Basic line graph using python module matplotlib
1import matplotlib.pyplot as plt
2plt.plot([1, 2, 3, 4])
3plt.ylabel('some numbers')
4plt.show()
5
1import numpy as np
2import matplotlib.pyplot as plt
3
4x = np.array([1, 3, 4, 6])
5y = np.array([2, 3, 5, 1])
6plt.plot(x, y)
7
8plt.show()