我尝试创建代码
\begin{tikzpicture}[scale=0.6]
\fill [mycolor] (0,0) rectangle (10,5.5);
\node at (0,-0.3) (A) {};
\node at (10,-0.3) (B) {};
\draw[->] (A.south) to[out=-20,in=-160] (B.south);
\node at (-0.2,0) (A2) {};
\node at (-0.2,5.5) (C) {};
\draw[->] (A2.west) to[out=140,in=-140] (C.west);
\node at (0,5.7) (C2) {};
\node at (10.2,0) (D) {};
\node at (11,6) (E) {};
\draw[->] (C.north) to[out=90,in=120] (E.south) to[out=270,in=0] (D.east);
\end{tikzpicture}
但是箭头不能按我想要的方式工作,而且我根本不擅长使用 Tikz。有人可以将我的绘图重新创建到 Tikz 中吗?
答案1
S_{1}
一种选择:和的箭头S_{2}
可以用 获得bend
; 标记的箭头R
可以用out=
,in=
语法加获得looseness
:
代码:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\colorlet{mycolor}{gray!10}
\begin{document}
\begin{tikzpicture}[scale=0.6,>=latex]
\path
coordinate (ll) at (0,0)
coordinate (ur) at (10,5.5)
coordinate (lr) at (ur|-ll)
coordinate (ul) at (ll|-ur);
\filldraw[mycolor,draw=black]
(ll) rectangle (ur);
\foreach \Name in {ll,ur,lr,ul}
\node[inner sep=2pt,fill,circle] at (\Name) {};
\draw[dashed]
([yshift=-15pt]{$ (ll)!0.5!(lr) $}) -- ([yshift=15pt]{$ (ul)!0.5!(ur) $})
([xshift=-15pt]{$ (ul)!0.5!(ll) $}) -- ([xshift=15pt]{$ (ur)!0.5!(lr) $});
\draw[->]
([xshift=-20pt]ll) to[bend left] node[left] {$S_{2}$} ([xshift=-20pt]ul);
\draw[->]
([yshift=-20pt]ll) to[bend right] node[below] {$S_{1}$} ([yshift=-20pt]lr);
\draw[->,overlay]
([yshift=20pt]ul) to[out=30,in=60,looseness=2] node[above] {$R$} ([xshift=20pt]lr);
\end{tikzpicture}
\end{document}
R
另一种选择是使用控制点获得标记的箭头:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\colorlet{mycolor}{gray!10}
\begin{document}
\begin{tikzpicture}[scale=0.6,>=latex]
\path
coordinate (ll) at (0,0)
coordinate (ur) at (10,5.5)
coordinate (lr) at (ur|-ll)
coordinate (ul) at (ll|-ur);
\filldraw[mycolor,draw=black]
(ll) rectangle (ur);
\foreach \Name in {ll,ur,lr,ul}
\node[inner sep=2pt,fill,circle] at (\Name) {};
\draw[dashed]
([yshift=-15pt]{$ (ll)!0.5!(lr) $}) -- ([yshift=15pt]{$ (ul)!0.5!(ur) $})
([xshift=-15pt]{$ (ul)!0.5!(ll) $}) -- ([xshift=15pt]{$ (ur)!0.5!(lr) $});
\draw[->]
([xshift=-20pt]ll) to[bend left] node[left] {$S_{2}$} ([xshift=-20pt]ul);
\draw[->]
([yshift=-20pt]ll) to[bend right] node[below] {$S_{1}$} ([yshift=-20pt]lr);
\draw[->,overlay]
([yshift=20pt]ul) .. controls (3,10) and (16,10).. node[right=3pt,pos=0.7] {$R$} ([xshift=20pt]lr);
\end{tikzpicture}
\end{document}