LaTex和Word中推荐使用的矢量图片格式

1、LaTex

推荐使用eps矢量格式。(该格式直接放在word中不会显示,但是通过插入word后双击打开查看

2、Word

推荐使用svg矢量格式。该格式可以直接插入word中。

3、plt保存代码

python 复制代码
import matplotlib.pyplot as plt

# 绘制图形
x = [1, 2, 3, 4, 5]
y1 = [1, 4, 9, 16, 25]
y2 = [1, 2, 3, 4, 5]
plt.plot(x, y1, label="Line 1")
plt.plot(x, y2, label="Line 2")

# 添加图例、设置背景透明
plt.legend(framealpha=0)

# 设置图形属性
plt.title("Example Plot")
plt.xlabel("X-axis")
plt.ylabel("Y-axis")

# 保存为EPS格式。transparent设置背景透明
plt.savefig("1.png", format="png",dpi=600,bbox_inches='tight',pad_inches=0,transparent=True)

# 保存为SVG格式
plt.savefig("2.svg", format="svg",dpi=600,bbox_inches='tight',pad_inches=0,transparent=True)

# 显示图形
plt.show()
相关推荐
gc_22997 小时前
学习C#调用OpenXml操作word文档的基本用法(31:学习图形类-1)
word·openxml·run·drawing
XMJ200211 小时前
解决包含visio图的Word文档转PDF后部分文字消失问题的一种方法
pdf·word
tedcloud12315 小时前
OfficeCLI部署教程:让AI直接操作Word、Excel和PPT
服务器·人工智能·word·excel
才疏学浅7432 天前
批量下载鹏程实验室数据的方法
java·开发语言·word
开开心心就好2 天前
免费开源的网课教学屏幕画板工具
windows·eureka·计算机外设·word·excel·etcd·csdn开发云
Metaphor6923 天前
使用 Python 加密或解密 Word 文档
python·安全·word
Bnews3 天前
推荐一些好用的pdf转word软件
pdf·word
Metaphor6924 天前
使用 Python 给 Word 文档设置背景
python·word
ComPDFKit4 天前
PDF 转 Word 评测:SDK、API、在线工具效果对比与选择指南
pdf·word·pdf转word·pdf转档·pdf to word
transuperb4 天前
WPS-word画出完美的三线表
word·写作·wps