在图像阵列上绘制网格

在图像阵列上绘制网格

我有一个很棒的故事要用图片来讲述。马耳他十字形正在加工和扭曲。因此,为了让它在纸上更直观,我需要像这样的网格使用 TikZ 在图像上绘图而是整个图像阵列。

如何在图像阵列上绘制网格。我有类似这样的图像序列,其中某些东西围绕图像轨迹移动,并希望给读者带来更多视觉效果。

\documentclass{article}

\usepackage{graphicx}
\usepackage{subfig}
\usepackage{multirow}
\usepackage{array}
\usepackage{color}
\usepackage{tikz}
\usepackage{graphicx}
\begin{document}

\begin{figure}
\centering
\advance\leftskip-3cm
\advance\rightskip-3cm

\begin{tabular}{llll}

\hspace{5mm}\subfloat[A]{\includegraphics[trim = 10mm 10mm 70mm 20mm,clip,scale=0.15]{image1}} &
\hspace{-5mm}\subfloat[A]{\includegraphics[trim = 10mm 10mm 70mm 20mm,clip,scale=0.15]{image2}}\\
\hspace{5mm}\subfloat[A]{\includegraphics[trim = 10mm 10mm 70mm 20mm,clip,scale=0.15]{image3}} &
\hspace{-5mm}\subfloat[A]{\includegraphics[trim = 10mm 10mm 70mm 20mm,clip,scale=0.15]{image4}} \\

\end{tabular}
\caption{Time Evolution}
\end{figure}
\end{document}

答案1

以下是使用 TikZ 和答案中的代码的可能性使用 TikZ 在图像上绘图

\documentclass{article}
\usepackage{subfig}
\usepackage[demo]{graphicx}
\usepackage{tikz}

\begin{document}

\begin{figure}
\centering
\begin{tikzpicture}
\node[anchor=south west,inner sep=0,align=center] (image) at (0,0) {%
\subfloat[A]{\includegraphics[trim = 10mm 10mm 70mm 20mm,clip,scale=0.15]{image1}}\quad
\subfloat[A]{\includegraphics[trim = 10mm 10mm 70mm 20mm,clip,scale=0.15]{image2}}\\
\subfloat[A]{\includegraphics[trim = 10mm 10mm 70mm 20mm,clip,scale=0.15]{image3}}\quad
\subfloat[A]{\includegraphics[trim = 10mm 10mm 70mm 20mm,clip,scale=0.15]{image4}}
};
\begin{scope}[x={(image.south east)},y={(image.north west)}]
\draw[help lines,xstep=.1,ystep=.1] (0,0) grid (1,1);
\foreach \x in {0,1,...,9} { \node [anchor=north] at (\x/10,0) {0.\x}; }
\foreach \y in {0,1,...,9} { \node [anchor=east] at (0,\y/10) {0.\y}; }
\end{scope}
\end{tikzpicture}
\caption{Time Evolution}
\end{figure}

\end{document}

在此处输入图片描述

答案2

在此处输入图片描述

\documentclass{article}


\usepackage{subfig}
\usepackage{multirow}
\usepackage{array}
\usepackage{color}

\usepackage[demo]{graphicx}
\begin{document}

\begin{figure}
\centering
%\advance\leftskip-3cm
%\advance\rightskip-3cm

\begin{tabular}{|c|c|}
\hline
\subfloat[A]{\includegraphics[trim = 10mm 10mm 70mm 20mm,clip,scale=0.15]{image1}} &
\subfloat[A]{\includegraphics[trim = 10mm 10mm 70mm 20mm,clip,scale=0.15]{image2}}\\
\hline
\subfloat[A]{\includegraphics[trim = 10mm 10mm 70mm 20mm,clip,scale=0.15]{image3}} &
\subfloat[A]{\includegraphics[trim = 10mm 10mm 70mm 20mm,clip,scale=0.15]{image4}} \\
\hline

\end{tabular}
\caption{Time Evolution}
\end{figure}
\end{document}

我添加了,demo因为我没有图像(您需要将其删除)

我将表格序言改为 2 列,因为正文只有两列。

我删除了左右跳过的设置(应该绝不直接在 LaTeX 中设置)

我添加了垂直和水平规则。


有规则超过图片:

在此处输入图片描述

\documentclass{article}


\usepackage{subfig}
\usepackage{multirow}
\usepackage{array}
\usepackage{color}

\usepackage[demo]{graphicx}
\begin{document}

\begin{figure}
\centering

\begin{tabular}[b]{cc}
\subfloat[A]{\includegraphics[trim = 10mm 10mm 70mm 20mm,clip,scale=0.15]{image1}} &
\subfloat[A]{\includegraphics[trim = 10mm 10mm 70mm 20mm,clip,scale=0.15]{image2}}\\
\subfloat[A]{\includegraphics[trim = 10mm 10mm 70mm 20mm,clip,scale=0.15]{image3}} &
\subfloat[A]{\includegraphics[trim = 10mm 10mm 70mm 20mm,clip,scale=0.15]{image4}} \\
\noalign{\null}
\end{tabular}\begin{picture}(0,0)
\color{blue}\setlength\unitlength{1mm}%
\multiput(0,0)(0,10){10}{\line(-1,0){120}}
\multiput(0,0)(-10,0){13}{\line(0,1){90}}
\end{picture}
\caption{Time Evolution}
\end{figure}
\end{document}

答案3

在此处输入图片描述

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{graphicx}

\newsavebox\IBox
\savebox\IBox{\includegraphics{example-image-a}}

\def\row{10}
\def\col{10}
\psset
{
    xunit=\dimexpr\wd\IBox/\col,
    yunit=\dimexpr\ht\IBox/\row,
}

\addtopsstyle{gridstyle}
{
    gridcolor=cyan,
    gridlabels=0pt,
}
\begin{document}
\begin{pspicture}[showgrid=top](\numexpr\col*2,\numexpr2*\row)
    \rput[bl](0,0){\usebox\IBox}
    \rput[bl](\col,0){\includegraphics{example-image-b}}
    \rput[bl](0,\row){\includegraphics{example-image-c}}
    \rput[bl](\col,\row){\includegraphics{example-image-a}}
\end{pspicture}
\end{document}

相关内容