starting_code.py 761 B

12345678910111213141516171819202122232425262728
  1. from matplotlib import pyplot as plt
  2. plt.style.use("fivethirtyeight")
  3. ages_x = [25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35]
  4. dev_y = [38496, 42000, 46752, 49320, 53200,
  5. 56000, 62316, 64928, 67317, 68748, 73752]
  6. plt.plot(ages_x, dev_y, color="#444444", label="All Devs")
  7. # py_dev_y = [45372, 48876, 53850, 57287, 63016,
  8. # 65998, 70003, 70000, 71496, 75370, 83640]
  9. # plt.plot(ages_x, py_dev_y, color="#008fd5", label="Python")
  10. # js_dev_y = [37810, 43515, 46823, 49293, 53437,
  11. # 56373, 62375, 66674, 68745, 68746, 74583]
  12. # plt.plot(ages_x, js_dev_y, color="#e5ae38", label="JavaScript")
  13. plt.legend()
  14. plt.title("Median Salary (USD) by Age")
  15. plt.xlabel("Ages")
  16. plt.ylabel("Median Salary (USD)")
  17. plt.tight_layout()
  18. plt.show()