我完全不知道该如何制作这张(我猜)相当简单的图片。任何帮助都将不胜感激
答案1
\documentclass[tikz,border=2mm]{standalone}
\begin{document}
\begin{tikzpicture}
\node[draw,circle,minimum width=2cm] at (0,0) (A) {};
\node[above] at (A.north) {$A$};
\draw (A.west) -- (A.east);
\path (A.center) -- node{$A-T$} (A.north);
\path (A.center) -- node{$T$} (A.south);
\node[draw,circle,minimum width=2cm] at (4,0) (B) {};
\node[above] at (B.north) {$B$};
\draw (B.west) -- (B.east);
\path (B.center) -- node{$B-f(T)$} (B.north);
\path (B.center) -- node{$f(T)$} (B.south);
\draw[>=latex,->] (B.north west) to [in=20,out=160] node[above] {$g$} (A.north east);
\draw[>=latex,->] (A.south east) to [in=200,out=340] node[below] {$f$} (B.south west);
\end{tikzpicture}
\end{document}
编辑:箭头的起点和终点都在圆圈内,箭头现在位于中间
通过使用该calc
库,可以计算箭头的起始(和终止)位置。例如,($(B.north east)!.8!(B.north west)$)
表示:箭头起始位置在 80% 处(B.north east)
,(B.north west)
使用该decorations.markings
库可以改变箭头的位置。
\documentclass[tikz,border=2mm]{standalone}
\usetikzlibrary{calc,decorations.markings}
\begin{document}
\tikzset{->-/.style={decoration={markings,mark=at position #1 with {\arrow{>}}},postaction={decorate}}}
\begin{tikzpicture}
\node[draw,circle,minimum width=2cm] at (0,0) (A) {};
\node[above] at (A.north) {$A$};
\draw (A.west) -- (A.east);
\path (A.center) -- node{$A-T$} ($(A.north)!.3!(A.center)$);
\path (A.center) -- node{$T$} ($(A.south)!.3!(A.center)$);
\node[draw,circle,minimum width=2cm] at (4,0) (B) {};
\node[above] at (B.north) {$B$};
\draw (B.west) -- (B.east);
\path (B.center) -- node{$B-f(T)$} ($(B.north)!.3!(B.center)$);
\path (B.center) -- node{$f(T)$} ($(B.south)!.3!(B.center)$);
\draw[>=latex,->-=.5] ($(B.north east)!.8!(B.north west)$) to [in=20,out=160] node[above] {$g$} ($(A.north east)!.2!(A.north west)$);
\draw[>=latex,->-=.5] ($(A.south east)!.2!(A.south west)$) to [in=200,out=340] node[below] {$f$} ($(B.south west)!.2!(B.south east)$);
\end{tikzpicture}
\end{document}
答案2
使用 Ti钾Z,这可能看起来像这样:
% arara: pdflatex
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes,positioning,decorations.markings}
\tikzset{%
,mynode/.style={circle split,draw, minimum size=2.05cm,text height=\heightof{$f$},text depth=\depthof{g}}
,->-/.style={%
decoration={%
,markings
,mark=at position #1 with {\arrow{>}}}
,postaction={decorate}
,shorten >=-3pt,shorten <=-3pt
}
}
\begin{document}
\begin{tikzpicture}
\node [mynode,label=90:$A$] (Anode) {$A-T$ \nodepart{lower} $\vphantom{f(}T$};
\node [mynode,label=90:$B$,right = of Anode] (Bnode) {$B-f(T)$ \nodepart{lower} $f(T)$};
\draw[->-=.53] (Anode) to [bend right=20] node[below]{$f$} (Bnode);
\draw[->-=.53] (Bnode) to [bend right=20] node[above]{$g$} (Anode);
\end{tikzpicture}
\end{document}