节点:斜指向

节点:斜指向

我能够绘制右边的图片(虽然不是同一种水果):

在此处输入图片描述

我遇到了一个问题。我的图中左侧的箭头不正确。我怎样才能使它倾斜?

\documentclass{article}

\usepackage{graphicx}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}

\node[inner sep=0pt] (boy)  at (0,0)
{\includegraphics[width=.15\textwidth]{boy.jpg}};

\node[inner sep=0pt] (girl1) at (0,5)
{\includegraphics[width=.15\textwidth]{girl.jpg}};

\node[inner sep=0pt] (girl) at (0,10)
{\includegraphics[width=.150\textwidth]{girl.jpg}};





\node[inner sep=0pt] (tangerine) at (10,0)
    {\includegraphics[width=.15\textwidth]{tangerine.png}};
\node[inner sep=0pt] (grapes) at (10,3)
    {\includegraphics[width=.15\textwidth]{grapes.png}};
%%\draw[<->,thick] (pera) -- (grapes)
   ;
\node[inner sep=0pt] (strawberry) at (10,6)
 {\includegraphics[width=.15\textwidth]{strawberry.png}};
\node[inner sep=0pt] (pera) at (10,9)
 {\includegraphics[width=.15\textwidth]{pera.png}};

\draw[-latex,thick] (girl1) -- (strawberry);


\draw[<->,thick] (girl.west) -- (boy.west);
\draw[-latex,thick] (girl) -- (grapes);
\draw[-latex,thick] (girl) -- (strawberry);
\draw[-latex,thick] (girl) -- (pera);
\draw[-latex,thick] (boy) -- (strawberry);
\draw[-latex,thick] (boy) -- (grapes);
\draw[-latex,thick] (girl) -- (tangerine);
\draw[latex-,dashed,thick] (boy) -- (pera);
\draw[latex-,dashed,thick] (boy) -- (tangerine);
\end{tikzpicture}
\end{document}

在此处输入图片描述

答案1

谢谢你,Marmot!

如果您愿意,这是最终版本:

\documentclass{article}

\usepackage{graphicx}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}

\node[inner sep=0pt] (boy)  at (0,0)
{\includegraphics[width=.15\textwidth]{boy.jpg}};

\node[inner sep=0pt] (girl1) at (0,5)
{\includegraphics[width=.15\textwidth]{girl.jpg}};

\node[inner sep=0pt] (girl) at (0,10)
{\includegraphics[width=.150\textwidth]{girl.jpg}};





\node[inner sep=0pt] (tangerine) at (10,0)
    {\includegraphics[width=.15\textwidth]{tangerine.png}};
\node[inner sep=0pt] (grapes) at (10,3)
    {\includegraphics[width=.15\textwidth]{grapes.png}};
%%\draw[<->,thick] (pera) -- (grapes)
   ;
\node[inner sep=0pt] (strawberry) at (10,6)
 {\includegraphics[width=.15\textwidth]{strawberry.png}};
\node[inner sep=0pt] (pera) at (10,9)
 {\includegraphics[width=.15\textwidth]{pera.png}};

\draw[-latex,thick,blue] (girl1) -- (strawberry);


\draw[<->,thick] (girl.west) to[out=-120,in=120] (boy.west);
\draw[-latex,thick] (girl) -- (grapes);
\draw[-latex,thick] (girl) -- (strawberry);
\draw[-latex,thick] (girl) -- (pera);
\draw[-latex,thick,blue] (boy) -- (strawberry);
\draw[-latex,thick,blue,fill=blue] (boy) -- (grapes);
\draw[-latex,thick] (girl) -- (tangerine);
\draw[latex-,dashed,thick] (boy) -- (pera);
\draw[latex-,dashed,thick] (boy) -- (tangerine);
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容