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()
相关推荐
wh39331 天前
使用Python将PDF转换成word、PPT
python·pdf·word
bu_shuo3 天前
word表格中使用公式
word·表格
不坑老师3 天前
利用不坑盒子的Copilot,快速排值班表
microsoft·word·powerpoint·excel·copilot·wps
开开心心就好3 天前
批量PDF转换工具,一键转换Word Excel
开发语言·前端·学习·pdf·电脑·word·excel
RainSerein4 天前
Laravel8中使用phpword生成word文档
word·php·laravel
qq_393828224 天前
办公文档批量打印器 Word、PPT、Excel、PDF、图片和文本,它都支持批量打印。
windows·word·powerpoint·excel·软件需求
_oP_i14 天前
实现 “WebView2 获取word选中内容
开发语言·c#·word
LENG_Lingliang14 天前
word出现由WPS切换后公式异常无法删除的情况处理
word·wps·mathtype
贤和兄14 天前
使用docx4j 实现word转pdf(linux乱码处理)
linux·pdf·word
开开心心就好15 天前
高效批量转换Word到PDF的方法
javascript·安全·智能手机·pdf·word·objective-c·lisp