Understanding the Fundamental Skills of using Matplotlib – Creating and Customizing Plots

Code used for running Matplotlib in Python:

 

from matplotlib import pyplot as plt

ages_x = [25,26,27,28,29,30,31,32,33,34,35]

dev_y = [38496,42000,46752,49320,53200,56000,62316,64928,67317,68748,73752]
plt.plot(ages_x,dev_y,color='445544',linestyle='--',linewidth=3,label='all developers')

py_dev_y = [45372,48876,53850,57287,63016,65998,70003,70000,71496,75370,83640]
plt.plot(ages_x,py_dev_y,color='#5a7d9a',linewidth=3,label = 'python developers')

js_dev_y = [37810,43515,46823,49293,53474,56373,62375,66674,68745,68746,74583]
plt.plot(ages_x,js_dev_y,color='#adad3b',linewidth=3,label = 'js developers')
            
plt.xlabel('ages')
plt.ylabel('median salary')
plt.title('Median salayr (USD) by age')

plt.legend()

plt.show()