代码拉取完成,页面将自动刷新
import matplotlib.pyplot as plt
from matplotlib.font_manager import FontProperties
font_set = FontProperties(fname=r"c:\windows\fonts\simsun.ttc", size=12)
#校准横坐标
input_values = [1,2,3,4,5]
squares = [1,4,9,16,25]
plt.plot(input_values,squares,linewidth=5)
#设置图表标题,并给坐标轴加上标签
plt.title("平方图标",fontsize=24,fontproperties=font_set)
plt.xlabel("数字",fontsize=14,fontproperties=font_set)
plt.ylabel("数字的平方值",fontsize=14,fontproperties=font_set)
#设置刻度标记
plt.tick_params(axis='both',labelsize=14)
plt.show()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。