Draw a simple line chart

1. Square number line chart

import matplotlib.pyplot as plt

input_values=[1,2,3,4,5]
squares=[1,4,9,16,25]
plt.plot(input_values,squares,linewidth=5)

plt.title("Square Numbers", fontsize=24)
plt.xlabel("Value", fontsize=14)
plt.ylabel("Square of Value", fontsize=14)

plt.tick_params(axis='both',labelsize=14)
plt.show()

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325727600&siteId=291194637