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
1# importing matplotlib module
2from matplotlib import pyplot as plt
3
4# x-axis values
5x = [5, 2, 9, 4, 7]
6
7# Y-axis values
8y = [10, 5, 8, 4, 2]
9
10# Function to plot scatter
11plt.scatter(x, y)
12
13# function to show the plot
14plt.show()