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()
相关推荐
Am-Chestnuts9 小时前
Kimi长回答批量导出Word:DS随心转实践
word
曹牧13 小时前
Word:更改列表级别
word
wtsolutions2 天前
Sheet-to-Doc Skill: Let AI Assistants Generate Word Documents for You
人工智能·word
qq_466302454 天前
如何在word中添加代码
word
一棵星4 天前
LibreOffice Word 转 PDF 报错 “source file could not be loaded” 完整解决方案
pdf·word
一棵星4 天前
记一次 Word 转 PDF 功能故障排查与修复
pdf·word
拆房老料5 天前
ONLYOFFICE AI Agent 深度解析:在线 Office 正从编辑器走向智能工作平台
人工智能·中间件·编辑器·word·开源软件
186******205316 天前
PDF 转 Word 高效办公实战指南
pdf·word
patrickpdx7 天前
Word批量修改指定字符的字体
word·word2016
asdzx678 天前
使用 Spire.WordJS 在 React 中实现在线 Word 文档编辑
前端·react.js·word