论文中用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*}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值