对应下面的代码:
\begin{table}[h]
\scriptsize
% \centering
\caption{Permutation Importance}
\resizebox{\textwidth}{!}{\begin{tabular}{lcccccccc} \toprule
& \ldots & $\text{M2}^{(\text{SMB})}$ & $\text{M2}^{(\text{HML})}$ & $\text{DJI}^{(\text{MOM})}$ & $\text{DJI}^{(\text{SMB})}$ & $\text{DJI}^{(\text{HML})}$ & $\text{CAPE}^{(\text{MOM})}$ & \ldots \\ \midrule
1 & \ldots & 0.20 & 1.93 & 0.10 & 0.32 & 1.39 & -2.50 & \ldots \\
2 & \ldots & -0.02 & 3.17 & -0.006 & -0.44 & 5.41 & -4.34 & \ldots \\
3 & \ldots & 0.54 & 5.53 & 0.10 & -2.71 & 21.82 & -6.61 & \ldots \\
4 & \ldots & 0.24 & 1.64 & 0.15 & -1.77 & 21.74 & -1.79 & \ldots \\
\ldots & \ldots & \ldots & \ldots & \ldots & \ldots & \ldots & \ldots & \ldots \\
\ldots & \ldots & \ldots & \ldots & \ldots & \ldots & \ldots & \ldots & \ldots \\
$N_{t} - 2$ & \ldots & 0.24 & 1.64 & 0.15 & -1.77 & 21.74 & -1.79 & \ldots \\
$N_{t} - 1$ & \ldots & 0.24 & 1.64 & 0.15 & -1.77 & 21.74 & -1.79 & \ldots \\
$N_{t}$ & \ldots & 0.24 & 1.64 & 0.15 & -1.77 & 21.74 & -1.79 & \ldots \\
\bottomrule
\end{tabular}} \label{tab:fac_char}
\end{table}
现在我的目的是为 DJI^(MOM)、DJI^(SMB) 和 DJI^(HML) 画箭头,以表明它们正在同时随机重新洗牌。我在网上看到了下面的图片,它说明了我对 1 列的意思:
我想我必须使用 Tikz 包,但我不知道从哪里开始。
答案1
这是一个起点。
\documentclass{article}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{matrix,decorations.pathreplacing,calc}
\begin{document}
\begin{tikzpicture}[fancy arrow/.style={decorate,decoration={
show path construction,
curveto code={
\draw[top color=red,bottom color=yellow]
let \p1=($(\tikzinputsegmentsupporta)-(\tikzinputsegmentfirst)$) in
[/utils/exec=\pgfmathsetmacro{\mysign}{sign(\x1)}]
([yshift=-1.5pt]\tikzinputsegmentfirst) .. controls
([yshift=-1.5pt]\tikzinputsegmentsupporta) and ([yshift=-1.5pt]\tikzinputsegmentsupportb)
..([yshift=-1.5pt,xshift=\mysign*3pt]\tikzinputsegmentlast)
-- ([yshift=-1.5pt,xshift=\mysign*1.5pt]\tikzinputsegmentlast)
-- ([yshift=-3pt,xshift=\mysign*1.5pt]\tikzinputsegmentlast)
-- (\tikzinputsegmentlast)
-- ([yshift=3pt,xshift=\mysign*1.5pt]\tikzinputsegmentlast)
-- ([yshift=1.5pt,xshift=\mysign*1.5pt]\tikzinputsegmentlast)
.. controls
([yshift=1mm]\tikzinputsegmentsupportb) and ([yshift=1mm]\tikzinputsegmentsupporta)
.. ([yshift=1mm]\tikzinputsegmentfirst) -- cycle;}}}]
\matrix[matrix of math nodes,cells={nodes={scale=0.8}},
column 1/.style={nodes={text width=4em,align=left}}] (mat) {
& \ldots & \text{M2}^{(\text{SMB})} & \text{M2}^{(\text{HML})} & \text{DJI}^{(\text{MOM})} & \text{DJI}^{(\text{SMB})} & \text{DJI}^{(\text{HML})} & \text{CAPE}^{(\text{MOM})} & \ldots \\
1 & \ldots & 0.20 & 1.93 & 0.10 & 0.32 & 1.39 & -2.50 & \ldots \\
2 & \ldots & -0.02 & 3.17 & -0.006 & -0.44 & 5.41 & -4.34 & \ldots \\
3 & \ldots & 0.54 & 5.53 & 0.10 & -2.71 & 21.82 & -6.61 & \ldots \\
4 & \ldots & 0.24 & 1.64 & 0.15 & -1.77 & 21.74 & -1.79 & \ldots \\
\ldots & \ldots & \ldots & \ldots & \ldots & \ldots & \ldots & \ldots & \ldots \\
\ldots & \ldots & \ldots & \ldots & \ldots & \ldots & \ldots & \ldots & \ldots \\
N_{t} - 2 & \ldots & 0.24 & 1.64 & 0.15 & -1.77 & 21.74 & -1.79 & \ldots \\
N_{t} - 1 & \ldots & 0.24 & 1.64 & 0.15 & -1.77 & 21.74 & -1.79 & \ldots \\
N_{t} & \ldots & 0.24 & 1.64 & 0.15 & -1.77 & 21.74 & -1.79 & \ldots \\
};
\draw[fancy arrow] (mat-2-5.east) to[out=0,in=0,looseness=1.5](mat-3-5.east);
\draw[fancy arrow] (mat-4-5.west) to[out=180,in=180,looseness=1.5](mat-3-5.west);
\path (mat-1-2.south) -- (mat-2-2.north) coordinate[pos=0.2] (aux);
\draw[very thick] (mat.north west) -- (mat.north east)
(aux-|mat.west) -- (aux-|mat.east) (mat.south west) -- (mat.south east);
\end{tikzpicture}
\end{document}