matplotlib绘制图像设置中文宋体,英文新罗马,字体大小7.5,坐标轴刻度线内侧

matplotlib绘制图像设置中⽂宋体,英⽂新罗马,字体⼤⼩7.5,坐标轴刻度线内
import matplotlib
import numpy as np
回首黄土地import matplotlib.pyplot as plt
from matplotlib import rcParams
matplotlib.use("pgf")
pgf_config ={
"font.family":'serif',
"font.size":7.5,#字体⼤⼩7.5
"fonts":False,
"text.usetex":True,
"pgf.preamble":[
网睡r"\usepackage{unicode-math}",
r"\setmainfont{Times New Roman}",
r"\usepackage{xeCJK}",
r"\setCJKmainfont{SimSun}",
],
}
rcParams.update(pgf_config)
x =[1,2,3,4,5]
y_y=[0.5,0.6,0.7,0.8,0.9]#原始图⽚代数几何
妈祖城网#Params['font.sans-serif'] = ['Microsoft YaHei']
#Params['axes.unicode_minus'] = False
流量生成
#plt.figure(50)
for i in range(len(y_y)):
<(x[i], y_y[i]+0.01,'%.3f'%(y_y[i]),ha='center')
plt.plot(x, y_y,'rp--')#,label='Integrated algorithm'
#plt.plot(x, y_1,'bp--',label='01')
rbd-573#plt.plot(x, y_2,'rp--',label='03')
#plt.plot(x, y_200,'gp-',label='data=200')
# set x limits
plt.xlim((0.8,5.2))
plt.ylim((0.8,1))
#plt.xlabel('Number of data preprocessing',fontsize=13)>####x轴代表
plt.xlabel('横纵')
plt.ylabel('纵轴')>>##y轴代表
plt.title('标题')>>#title 14
#plt.legend(loc='upper left',fontsize=13)
#plt.show()
plt.savefig('./集成2.png', dpi=800)
第⼀次运⾏需要安装插件,需要等待⼀会,安装完毕重新运⾏等待运⾏结束,查看保存图⽚的路径即可

本文发布于:2024-09-22 18:23:13,感谢您对本站的认可!

本文链接:https://www.17tex.com/xueshu/143802.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:刻度   需要   等待   安装   保存   结束
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2024 Comsenz Inc.Powered by © 易纺专利技术学习网 豫ICP备2022007602号 豫公网安备41160202000603 站长QQ:729038198 关于我们 投诉建议