如何在两张图片之间画一条带弯曲箭头的虚线(带有上面的表达式)?

如何在两张图片之间画一条带弯曲箭头的虚线(带有上面的表达式)?

我使用tikzpicture环境,得到以下图片: 在此处输入图片描述

\begin{minipage}{.5\textwidth}
\centering

\begin{tikzpicture}[x=1.5cm,y=1.5cm] 

\draw[gray!50, thin, step=0.5] (-.5,-.5) grid (2,2);
\draw[thick,->] (-.5,0) -- (2.2,0) node[right] {$x$};
\draw[thick,->] (0,-.5) -- (0,2.2) node[above] {$y$};

\foreach \x in {1,2} \draw (\x,0.05) -- (\x,-0.05) node[below] {\x};
\foreach \y in {1,2} \draw (-0.05,\y) -- (0.05,\y) node[left] {\y};

\fill[blue!50!cyan,opacity=0.3] (0,0) -- (1,1) -- (1,0) -- cycle;

\draw (0,0) -- (1,1);
\draw (1,1) -- (1,0);   

\node at (.75,.25) {$T$};
\node at (1.15,1.15) {${\bf C}$};
\node at (-.15,-0.15) {${\bf A}$};
\node at (1.15,-0.15) {${\bf B}$};

\foreach \Point in {(0,0), (1,0), (1,1)}{
\node at \Point {\textbullet};
}
\end{tikzpicture}
\end{minipage}
\begin{minipage}{.5\textwidth}
\centering
\begin{tikzpicture}[x=1.5cm,y=1.5cm] 
%graph
\draw[fill=gray!50!white] 

plot[smooth,samples=100,domain=0:1] (\x,{2*sqrt(1-\x)}) -- 
plot[smooth,samples=100,domain=1:0] (\x,{0});


%coordinate grid
\draw (-.5,0)--(2.5,0) node[right]{$u$};
\draw (0,-.5)--(0,2.5) node[above]{$v$};
\foreach \x in {1,2}
\draw (\x,2pt)--(\x,-2pt) node[below] {\x};

\foreach \y in {1,2}
\draw (2pt,\y)--(-2pt,\y) node[left] {\y};    
%labels 
\node at (.5,.5) {$f(T)$};
\node at (-.35,2.25) {$f{\bf (C)}$};
\node at (-.35,-0.25) {$f{\bf (A)}$};
\node at (1.35,-0.25) {$f{\bf (B)}$};
\node at (1.6,1) {$u=1-v^2/4$};

\foreach \Point in {(0,0), (0,2), (1,0)}{
\node at \Point {\textbullet};
}

\end{tikzpicture}

\end{minipage}

如何在这两张图片之间绘制一条带箭头的虚线(带有上面的表达式)?我期望如下所示: 在此处输入图片描述

答案1

使用该tikztikzmark非常简单:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{tikzmark}
\begin{document}
\begin{minipage}{.5\textwidth}
\centering

\begin{tikzpicture}[x=1.5cm,y=1.5cm] 

\draw[gray!50, thin, step=0.5] (-.5,-.5) grid (2,2);
\draw[thick,->] (-.5,0) -- (2.2,0) node[right] {$x$};
\draw[thick,->] (0,-.5) -- (0,2.2) node[above] {$y$};

\foreach \x in {1,2} \draw (\x,0.05) -- (\x,-0.05) node[below] {\x};
\foreach \y in {1,2} \draw (-0.05,\y) -- (0.05,\y) node[left] {\y};

\fill[blue!50!cyan,opacity=0.3] (0,0) -- (1,1) -- (1,0) -- cycle;

\draw (0,0) -- (1,1);
\draw (1,1) -- (1,0);   

\node at (.75,.25) {$T$};
\node at (1.15,1.15) {${\bf C}$};
\node at (-.15,-0.15) {${\bf A}$};
\node at (1.15,-0.15) {${\bf B}$};

\foreach \Point in {(0,0), (1,0), (1,1)}{
\node at \Point {\textbullet};
\node at (2.1,1) {\tikzmark{leftpic}};%<= location for start of arrow
}
\end{tikzpicture}
\end{minipage}
\begin{minipage}{.5\textwidth}
\centering
\begin{tikzpicture}[x=1.5cm,y=1.5cm] 
%graph
\draw[fill=gray!50!white] 

plot[smooth,samples=100,domain=0:1] (\x,{2*sqrt(1-\x)}) -- 
plot[smooth,samples=100,domain=1:0] (\x,{0});


%coordinate grid
\draw (-.5,0)--(2.5,0) node[right]{$u$};
\draw (0,-.5)--(0,2.5) node[above]{$v$};
\foreach \x in {1,2}
\draw (\x,2pt)--(\x,-2pt) node[below] {\x};

\foreach \y in {1,2}
\draw (2pt,\y)--(-2pt,\y) node[left] {\y};    
%labels 
\node at (.5,.5) {$f(T)$};
\node at (-.35,2.25) {$f{\bf (C)}$};
\node at (-.35,-0.25) {$f{\bf (A)}$};
\node at (1.35,-0.25) {$f{\bf (B)}$};
\node at (1.6,1) {$u=1-v^2/4$};

\foreach \Point in {(0,0), (0,2), (1,0)}{
\node at \Point {\textbullet};
\node at (-0.4,1.5) {\tikzmark{rightpic}};%<= location for end of arrow
}

\end{tikzpicture}
\end{minipage}

\begin{tikzpicture}[overlay, remember picture]
\draw[->,>=stealth, red, thick,dashed] (pic cs:leftpic) to [bend left] node[midway,above,black]{upper $\to$} node[midway, below,black] {$x$} (pic cs:rightpic) ;
\end{tikzpicture}
\end{document}

我把它变成了虚线,并在上方和下方添加了一些文字。我还调整了位置以模仿预期结果。希望这些足以让你开始。 蒂克兹马克

相关内容