import matplotlib.pyplot as plt
input_values = [1, 2, 3, 4, 5]
squares = [1, 4, 9, 16, 25]
plt.scatter(input_values, squares, s=100)
#設(shè)置圖表標(biāo)題并給坐標(biāo)軸加上書簽
plt.title('Squares', fontsize=24)
plt.xlabel('Value', fontsize=14)
plt.ylabel('Squares of value', fontsize=14)
#設(shè)置刻度標(biāo)記的大小
plt.tick_params(axis='both', which='major', labelsize=14)#刻度的樣式
plt.show()

Paste_Image.png