我正在尝试插入一组相同尺寸(1416x1158)的图片。在一些子图内,有一张放大的图片。另外,我正在使用 tikz 节点添加标题。但有一个问题,图片之间的间距不同。
似乎添加 inset 会以某种方式改变图片的有效宽度,因为我尝试添加\hspace{0}
,但它没有帮助。大家帮帮我!我使用过一个代码:
%\listfiles
\documentclass [review]{elsarticle} %review, draft
\usepackage{subcaption,fullpage}
\usepackage{float}
\usepackage{wrapfig}
\usepackage{tikz}
\usepackage{adjustbox} %rescaling of tikz pics
\usepackage{pgfplotstable}
\pgfplotsset{compat=1.8}
\usepackage{pgfplots}
% to border pictures
\setlength{\fboxsep}{0.005pt}
\newcommand{\tmpframe}[1]{\fbox{#1}}
%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\newcommand{\mw}{0.233\textwidth}
\newcommand{\maw}{1.0\linewidth}
\newcommand{\mysubfigure}[2]{
\begin{subfigure}[b]{\mw}
\begin{adjustbox}{width=\maw,
% height=\mah
}
\begin{tikzpicture}
\node[inner sep=0pt] (O) at (0,0)
{\tmpframe{\includegraphics[trim={0.5cm 0 0.5cm 0},clip,width=1.1\linewidth]{#1}}};
\node[align=center,fill=white,draw] at (0,-1.2) {#2};
\ifdefined\mycap
\node[align=center,fill=white,draw] at (-1.6,-1.2) {\mycap};
\fi
\end{tikzpicture}
\end{adjustbox}
\end{subfigure}
\hspace{0.0cm}%
}
\newcommand{\mysubfigureinset}[9]{
\begin{subfigure}[b]{\mw}
\begin{adjustbox}{width=\maw,
% height=\mah
}
\begin{tikzpicture}
\node[inner sep=0pt] (O) at (0,0)
{\tmpframe{\includegraphics[trim={0.5cm 0 0.5cm 0},clip,width=1.1\linewidth]{#1}}};
\node[align=center,fill=white,draw] at (0,-1.2) {#2};
\node[anchor=north east] at (#7,#8) {\tmpframe{\includegraphics[trim={#3 #4 #5 #6},clip,width={#9\linewidth}]{#1}}};
\ifdefined\mycap
\node[align=center,fill=white,draw] at (-1.6,-1.2) {\mycap};
\fi
\end{tikzpicture}
\end{adjustbox}
\end{subfigure}
\hspace{0.0cm}%
}
\begin{figure}[H]
\hspace{-0.0cm}%
\begin{subfigure}[b]{\mw}
\begin{adjustbox}{width=\maw,
% height=\mah
}
\begin{tikzpicture}
\node[inner sep=0pt] (O) at (0,0)
{\tmpframe{\includegraphics[trim={0.5cm 0 0.5cm 0},clip,width=1.1\linewidth]{pic.png}}};
\draw[thick,->] (-1.35,0) -- (-1.35 + 0.35,0.4) node[pos=1, above] {$R_b$};
\draw[thick,->] (-1.35,0) -- (-1.35 - 0.15,0.2) node[pos=1, below] {{${\scriptscriptstyle R_s}$}};
\node[align=center,fill=white,draw] at (0,-1.2) {$t=0$};
\node[align=center,fill=white,draw] at (-1.6,-1.2) {(a)};
\end{tikzpicture}
\end{adjustbox}
\end{subfigure}
\hspace{0.1cm}%
% \mysubfigure{P/Moving_solid/BPM_t=0.png}{(a) $t=0$}
\mysubfigureinset{pic.png}{$t=0.4$}{740}{570}{580}{470}{2.15}{1.8}{0.31}
\mysubfigure{pic.png}{$t=1.65$}
\mysubfigureinset{pic.png}{$t=2.25$}{610}{510}{680}{510}{2.15}{1.8}{0.35}
%
\newcommand{\mycap}{(b)}
\mysubfigureinset{pic.png}{$t=1.5$}{950}{530}{300}{470}{-0.}{1.8}{0.48}
\let\mycap\undefined
\mysubfigure{pic.png}{$t=1.6$}
\mysubfigureinset{pic.png}{$t=1.65$}{1000}{510}{200}{450}{-0.}{1.8}{0.5}
\mysubfigure{pic.png}{$t=2.25$}
%
\newcommand{\mycap}{(c)}
\mysubfigure{pic.png}{$t=1.65$}
\let\mycap\undefined
\mysubfigure{pic.png}{$t=1.68$}
\mysubfigureinset{pic.png}{$t=3.6$}{950}{510}{300}{510}{0.05}{1.8}{0.51}
\mysubfigureinset{pic.png}{$t=13.6$}{950}{510}{300}{510}{0.05}{1.8}{0.51}
%
\newcommand{\mycap}{(d)}
\mysubfigure{pic.png}{(d) $t=1.5$}
\let\mycap\undefined
\mysubfigure{pic.png}{$t=1.65$}
\mysubfigure{pic.png}{$t=2.25$}
\mysubfigureinset{pic.png}{$t=15.6$}{1150}{510}{100}{510}{-0.}{1.8}{0.5}
%
\caption{caption}
\label{fig:moving_ring}
\end{figure}
\end{document}