tikzpicture中节点标签的定位名称

tikzpicture中节点标签的定位名称

我有下图:

\documentclass{article}
\usepackage{amsmath,amsfonts,graphicx}
\usepackage{algpseudocode}
\usepackage{tikz, nth}
\usetikzlibrary{arrows.meta,decorations,decorations.pathreplacing,calc,bending,positioning, chains}

\begin{document}
\begin{tikzpicture}[scale=0.6]
        \draw[thick,]  (0,8) -- (0,0) node[left] {0};
        \draw[thick,]  (0,0) -- (8,0) node[right] {8};
        \draw[thick,]  (8,8) -- (8,0) node[left] {};
        \draw[thick,]  (8,8) -- (0,8) node[left] {8};

        \draw[thick,]  (4,0) -- (4,8) node[left] {};

        \fill (1, 4) circle[radius=2.5pt] node[below]{$A$};
        \fill (2, 6) circle[radius=2.5pt] node[below]{$B$};
        \fill (3, 2) circle[radius=2.5pt] node[below]{$C$};
        \fill (4, 8) circle[radius=2.5pt] node[below]{$D$};
        \fill (7, 3) circle[radius=2.5pt] node[below]{$E$};
        \fill (6, 1) circle[radius=2.5pt] node[below]{$F$};
        \fill (5, 7) circle[radius=2.5pt] node[below]{$G$};
        \fill (3, 8) circle[radius=2.5pt] node[below]{$H$};
\end{tikzpicture}
\end{document}

我怎样才能将节点的标题放置在$D$下方和左侧,以便线条不会遮挡标题?

答案1

让我们将评论转换为答案:定位节点、标签的逻辑与地平线两侧的命名逻辑相同。例如:我们总是说西南(左下方的同义词)和较新的西南(= 左下方)...

关于您的 MWE:看看以下更简洁的 MWE 代码是否对您有用:

\documentclass{article}
\usepackage{amsmath,amsfonts,graphicx}
\usepackage{algpseudocode}
\usepackage{tikz, nth}
\usetikzlibrary{arrows.meta,decorations,decorations.pathreplacing,calc,bending,positioning, chains}

\begin{document}
\begin{tikzpicture}[scale=0.6,
dot/.style = {circle, fill=black, inner sep=0pt, minimum size=5pt,
              node contents={}},
                    ]
\draw[thick]  (0,8)      node[left] {8}
                -- (0,0) node[left] {0}
                -- (8,0) node[right] {8}
                -- (8,8) -- cycle;
\draw[thick,]  (4,0) -- (4,8) node[left] {};

\path (1,4) node[dot,label=below:$A$];
\path (2,6) node[dot,label=below:$B$];
\path (3,2) node[dot,label=below:$C$];
\path (4,8) node[dot,label=below left:$D$];
\path (7,3) node[dot,label=below:$E$];
\path (6,1) node[dot,label=below:$F$];
\path (5,7) node[dot,label=below:$G$];
\path (3,8) node[dot,label=below:$H$];
    \end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容