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()
相关推荐
SiYuanFeng1 天前
【Word 排版】文本框/文字行间距异常偏大的解决方案
word
belldeep1 天前
python:markdown + python-docx 将 Markdown 文件格式转为 Word 文档
python·word·markdown·docx
gc_22991 天前
学习C#调用OpenXml操作word文档的基本用法(16:学习文档脚注类)
word·openxml·脚注
Fighting_p1 天前
【预览word文档】使用插件 docx-preview 预览线上 word 文档
开发语言·c#·word
薛定谔的猫-菜鸟程序员2 天前
基于Node.js+Pandoc实现Markdown文件无损转换为Word文档的小工具
node.js·word·vim
森森-曦2 天前
在word中如何设置从第二页开始页码编号
word
爱学习 爱分享2 天前
word中批量替换
word
selina89212 天前
word中脚注编号如何设置不显示?
word
叫我莫言鸭2 天前
关于word生成报告的POI学习
学习·word
AscendKing2 天前
java poi word首行插入文字
java·c#·word