表格旁边的箭头

表格旁边的箭头

长期听众,第一次打电话。我有一张桌子

\begin{center}
\begin{tabular}{cc}

还有两列图片,显示特定参数增加的结果。我试图在表格旁边放置一个带有大箭头的长而粗的箭头,以显示参数增加的方向,如下所示:

   ------   ------
   |    |   |     |
   |    |   |     |
_  ------   ------
|  
|  ------   ------
|  |    |   |     |
|  |    |   |     |
|  ------   ------
|  
|  ------   ------
V  |    |   |     |
   |    |   |     |
   ------   ------

我正在尝试使用 tikz 箭头,其中整个 tikz 图片是第三列多行,但它粘在列的顶部,并且不像我画的那样垂直对齐。我也没有设法沿着曲线“增加 \lambda”书写。

任何帮助都将不胜感激。也许有更好的方法来实现这一点。

编辑

我实际上无法添加一个真正有效的例子,因为它有我硬盘上的图片,但它看起来简单像这样:

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}

\begin{document}

\begin{center}
\begin{tabular}{cc}

\textbf{Original} & \textbf{Noisy}\\
\includegraphics[scale=.25]{example-image-a} &
\includegraphics[scale=.25]{example-image-b}\\
~\\
$\boldsymbol{ \ell_1 }$\textbf{ regularisation} & \textbf{TV regularisation} \\
\includegraphics[scale=.25]{example-image-c} &
\includegraphics[scale=.25]{example-image}\vspace{5pt}\\
\includegraphics[scale=.25]{example-image} &
\includegraphics[scale=.25]{example-image}\vspace{5pt}\\
\includegraphics[scale=.25]{example-image} &
\includegraphics[scale=.25]{example-image}
\end{tabular}
\end{center}

\end{document}

答案1

以下是使用tikz

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{tikz}
\begin{document}

\begin{center}
\begin{tabular}{cc}
\textbf{Original}                                                     & \textbf{Noisy}              \\
\llap{\tikz[remember picture]\node (top node){};\hspace*{1em}}%%
\raisebox{-0.25\height}{\includegraphics[scale=.25]{example-image-a}} &                             
\raisebox{-0.25\height}{\includegraphics[scale=.25]{example-image-b}}                               \\
~                                                                                                   \\
$\boldsymbol{ \ell_1 }$\textbf{ regularisation}                       & \textbf{TV regularisation}  \\
\includegraphics[scale=.25]{example-image-c}                          &                             
\includegraphics[scale=.25]{example-image}\vspace{5pt}                                              \\
\includegraphics[scale=.25]{example-image}                            &                             
\includegraphics[scale=.25]{example-image}\vspace{5pt}                                              \\
\llap{\tikz[remember picture]\node (bottom node){};\hspace*{1em}}%%
\raisebox{-0.5\height}{\includegraphics[scale=.25]{example-image}}    & 
\raisebox{-0.5\height}{\includegraphics[scale=.25]{example-image}}


\end{tabular}
\end{center}

\begin{tikzpicture}[remember picture, overlay]
  \draw[->,very thick] (top node) -- (bottom node);
\end{tikzpicture}

\end{document}

通过改变的值,\raisebox{<multiplier>\height}您可以控制图像的基线的位置,从而控制箭头的开始和结束的位置。

您可以将箭头样式和箭头的粗细更改为:

\draw[-stealth,line width=10pt,] (top node) -- (bottom node);

这将给出优步粗箭。

在此处输入图片描述

tikz matrix您还可以使用该库 来执行此操作,而不必处理覆盖:

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}

\begin{tikzpicture}
\matrix[matrix of nodes,row sep={2pt},column sep={2pt}]
{
                         & [0.5cm]  \textbf{Original}                                            & \textbf{Noisy}                                                         \\
  \node (top node){};    & \raisebox{-0.55\height}{\includegraphics[scale=.25]{example-image-a}} & \raisebox{-0.55\height}{\includegraphics[scale=.25]{example-image-b}}  \\[14pt]
                         & $\boldsymbol{ \ell_1 }$\textbf{ regularisation}                       & \textbf{TV regularisation}                                             \\
                         & \includegraphics[scale=.25]{example-image-c}                          & \includegraphics[scale=.25]{example-image}\vspace{5pt}                 \\
                         & \includegraphics[scale=.25]{example-image}                            & \includegraphics[scale=.25]{example-image}\vspace{5pt}                 \\
  \node (bottom node){}; & \raisebox{-0.45\height}{\includegraphics[scale=.25]{example-image}}   & \raisebox{-0.45\height}{\includegraphics[scale=.25]{example-image}}    \\
};
\draw[-stealth,line width=10pt,] (top node) -- (bottom node);
\end{tikzpicture}

\end{document}

相关内容