我正在尝试绘制以下图像(没有潦草的线条):
到目前为止,我可以得出以下代码:
\documentclass{article}
\usepackage{tikz}
\begin{tikzpicture}[
corner/.style={font=\bfseries\large\sffamily},
arrow/.style={->,>=stealth,thick},
label/.style={font=\small\sffamily,fill=white,midway},
contra/.style={thick}
]
\node[corner] (E) at (2,1) {$^{+}\Sigma^{-}$};
\node[corner] (O) at (2,-1) {$^{+}\Psi^{-}$};
\node[corner] (I) at (-2,-1) {$^{+}\Theta^{-}$};
\node[corner] (A) at (-2,1) {$^{+}\Delta^{-}$};
\draw[contra] (A) -- (I);
\draw[contra] (E) -- (O);
\draw[contra, dotted] (A) -- (O);
\draw[contra, dotted] (I) -- (E);
\draw[contra] (A) -- (E);
\draw[contra] (I) -- (O);
\end{tikzpicture}
\end{document}
我不知道如何将圆形图放在框的中间,并从正方形的四个角延伸到框的中间画出虚线(上面有“R”)。
有人知道如何做到这一点吗?
答案1
您可以使用具有白色背景的椭圆节点,如下所示:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes}
\begin{document}
\begin{tikzpicture}[
corner/.style={font=\bfseries\large\sffamily},
arrow/.style={->,>=stealth,thick},
label/.style={font=\small\sffamily,fill=white,midway},
contra/.style={thick}
]
\node[corner] (E) at (2,1) {$^{+}\Sigma^{-}$};
\node[corner] (O) at (2,-1) {$^{+}\Psi^{-}$};
\node[corner] (I) at (-2,-1) {$^{+}\Theta^{-}$};
\node[corner] (A) at (-2,1) {$^{+}\Delta^{-}$};
\draw[contra] (A) -- (I);
\draw[contra] (E) -- (O);
\draw[contra, dotted] (A) -- (O);
\draw[contra, dotted] (I) -- (E);
\draw[contra] (A) -- (E);
\draw[contra] (I) -- (O);
\node[draw, fill=white, ellipse] at (0,0) {$\Gamma+\Pi$} node[above left=0.3cm] {R};
\end{tikzpicture}
\end{document}