一、LaTeX中插入Visio图片
1、方法一
1.在Visio中画好图,保存成pdf文件;
2.打开pdf文件,将其裁剪成需要的大小;
3.在LaTeX中插入该pdf图片。
2、方法二
1.在Visio中画好图,然后依次选择“设计”->“大小”->“适应绘图”。然后另存为pdf文件;
2.在LaTeX中插入该pdf图片即可。
1.在Visio中画好图,然后依次选择“设计”->“大小”->“适应绘图”。然后另存为pdf文件;
使用福昕PDF编辑器裁剪PDF页面
二、LaTex插入eps文件
1、方法一
直接插入:
- 导入宏包:将模板中的这三句注释取消。
\usepackage[dvips]{graphicx}
\graphicspath{{../pdf/}}
\DeclareGraphicsExtensions{.eps}
如下图所示:
% or other class option (dvipsone, dvipdf, if not using dvips). graphicx
% will default to the driver specified in the system graphics.cfg if no
% driver is specified.
\usepackage[dvips]{graphicx}
% declare the path(s) where your graphic files are
\graphicspath{{../pdf/}}
% and their extensions so you won't have to specify these with
% every instance of \includegraphics
\DeclareGraphicsExtensions{.eps}
- 插入图片:
\begin{figure}
\centering %图片居中
\includegraphics[width=0.4\textwidth]{hand2_confusion.eps} %插入图片,[]中设置图片大小,{}中是图片文件名
\caption{Accuracy of hand gesture set and pinch gesture set for electrodes arranged on two positions: Hand Location and Wrist Location} %最终文档中希望显示的图片标题
% \label{Fig.main3} %用于文内引用的标签
\end{figure}
2、方法二
- 为了避免直接在原文中并排插入多张eps图片,用ps打开eps文件,排好插图。
一般python生成eps图片的代码。请参考
import matplotlib.pyplot as plt
x_label = 'AB'
y_label = 'CD'
#设置图例并且设置图例的字体及大小
font1 = {'family' : 'Times New Roman',
'weight' : 'normal',
'size' : 20,
}
#设置坐标刻度值的大小以及刻度值的字体
plt.tick_params(labelsize=25)
labels = ax.get_xticklabels() + ax.get_yticklabels()
[label.set_fontname('Times New Roman') for label in labels]
#设置横纵坐标的名称以及对应字体格式
font2 = {'family' : 'Times New Roman',
'weight' : 'normal',
'size' : 30,
}
#加上坐标名称
plt.xlabel(x_label, font2)
plt.ylabel(y_label, font2)
# ax为两条坐标轴的实例
ax=plt.gca()
#坐标轴上刻度保留位数
ax.xaxis.set_major_formatter(ticker.FormatStrFormatter('%1.2f')) #坐标刻度保留两位小数
ax.yaxis.set_major_formatter(ticker.FormatStrFormatter('%1.2f'))
#把x轴的刻度间隔设置为0.01,并存在变量里
x_major_locator=MultipleLocator(0.01)
#把y轴的刻度间隔设置为0.01,并存在变量里
y_major_locator=MultipleLocator(0.01)
#把x轴的主刻度设置为1的倍数
ax.xaxis.set_major_locator(x_major_locator)
#把y轴的主刻度设置为10的倍数
ax.yaxis.set_major_locator(y_major_locator)
#把x轴的刻度范围设置为-0.5到11,因为0.5不满一个刻度间隔,所以数字不会显示出来,但是能看到一点空白
plt.xlim(1.99,2.05)
#把y轴的刻度范围设置为-5到110,同理,-5不会标出来,但是能看到一点空白
plt.ylim(1.985,2.03)
#加上图例(handlelength为图例句柄的长度)
plt.legend(loc='upper right',prop=font1,handlelength=0.01)
plt.savefig(inputFilePath+"\\hand.eps",dpi=600,bbox_inches = 'tight')#解决图片不清晰,不完整的问题
plt.show()
常用命令:图像->画布大小;移动工具;文字工具;Ctrl+T(修改ps中图片尺寸);Ctrl+‘‘+’’(放大缩小);
排好版后,加入文字,输出为PDF,再在PDF中剪裁。