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()
相关推荐
蝈蝈噶蝈蝈噶15 小时前
poi-tl填充柱状图折线图无法指定y坐标轴导致重复数据
java·word
gc_229915 小时前
学习C#调用OpenXml操作word文档的基本用法(35:学习图形类-5)
word·openxml·图表·drawing
weixin_4166600717 小时前
Gemini 里的公式怎么转到 Word?保留公式、表格和排版的方法
word
诸葛大钢铁17 小时前
知网CAJ格式文件如何转为Word/PDF?CAJ转Word的三个免费方法
pdf·word·知网·caj·caj转word
gc_22992 天前
学习C#调用OpenXml操作word文档的基本用法(34:学习图形类-4)
word·openxml·anchor·浮动式布局
yuhulkjv3352 天前
腾讯元宝公式粘贴word乱码
人工智能·chatgpt·word·deepseek·ai导出鸭
hef2882 天前
Java读取Word图片坐标的两种方法
java·开发语言·word
OEC小胖胖3 天前
ChatGPT导出Word怎么做?Chat2File 安装与使用教程
chatgpt·word·效率工具·ai工具·浏览器扩展
庖丁AI3 天前
合同比对工具怎么选?Word、PDF 和扫描件差异对比思路
pdf·word
你挚爱的强哥3 天前
【样式问题】将当前word所有文字样式、字体、字号大小 全局设置为以后任何一个新的空白文档都共享使用
word