论文中用matplotlib画的图,如何保持大小一致。
1.首先在画图时,先要在matplotlib中确定图的尺寸,如果不设置,默认[宽,高]是[6.4,4.8]英寸
2.需要设置子图的左下坐标,即图位于画布的哪个位置
plt.gcf().subplots_adjust(left=0.15, bottom=0.18)
只有这里固定了,位于同一行的图才能水平对齐,
3.保存时存在的问题
plt.show()
之后,展示图片的程序,窗口大小我们是可以调节的,窗口大小也会影响保存的图片形状
为了减少变量,将程序最大化后,再点击左下角的保存。
4.latex排版时存在的问题
需要设置宽度和高度,但是同时设置宽度和高度会导致图片变形,可以仅设置宽度
\begin{figure*}\centering\begin{minipage}{0.32\linewidth}\centering\includegraphics[height=4cm,width=6cm]{figure/cu-utility-epoch.pdf}\caption{xxx}\label{uti}\end{minipage}\hfill\begin{minipage}{0.32\linewidth}\centering\includegraphics[height=4cm,width=6cm]{figure/regret-epoch.pdf}\caption{xxx}\label{reg}\end{minipage}\hfill\begin{minipage}{0.32\linewidth}\centering\includegraphics[height=4cm,width=6cm]{figure/CSTx-delay.pdf}\caption{xxx} \label{ctx}\end{minipage}
\end{figure*}