Ai
1 Star 0 Fork 0

leetone/my_python

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
mpl_squares.py 577 Bytes
一键复制 编辑 原始数据 按行查看 历史
leetone 提交于 2018-08-15 13:09 +08:00 . 统计平方的折线图
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()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/leetone123/my_python.git
git@gitee.com:leetone123/my_python.git
leetone123
my_python
my_python
master

搜索帮助