使用节点和文本绘制线条

使用节点和文本绘制线条

有人可以帮我在乳胶中画这个吗?

有人能帮我用乳胶画一下吗?我的尝试如下

\begin{tikzpicture}[xscale=2]
  \draw [thick, draw=black, *-*] (0,0) -- (7,0);
  \node[circle,fill=black,inner sep=0pt,minimum size=6pt,label=below:{$z_1 = 0$}] (a) at (-,-) {};
  \node[circle,fill=black,inner sep=0pt,minimum size=6pt,label=below:{$z_2 = 1$}] (b) at (1,0) {};
  \node[circle,fill=black,inner sep=0pt,minimum size=6pt,label=below:{$z_3 = 3$}] (c) at (2,0) {};
  \node[circle,fill=black,inner sep=0pt,minimum size=6pt,label=below:{$z_j = d(j-1)/N$}] (d) at (4,0) {};
  \node[circle,fill=black,inner sep=0pt,minimum size=6pt,label=below:{$z_N = d(j-1)/N$}] (e) at (5.8,0) {};
  \node[circle,fill=black,inner sep=0pt,minimum size=6pt,label=below:{$z_{N+1} = d$}] (f) at (7,0) {};
\end{tikzpicture}

答案1

因为你表现出了一些 TiZ 代码,您可以尝试使用matrix,它允许您将线附加到某些矩阵单元:

\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{matrix}

\begin{document}

\begin{tikzpicture}

\matrix[matrix of math nodes, nodes={text depth=.25em, text height=1em}, 
        font=\small, column 1/.style={anchor=base west}, column sep=5pt] (m) {
%
                        & z_1 = 0 & z_2 = d/N & z_3 = 2d/N & \cdots &
                          z_j = (j - 1)d/N & \cdots & z_N = (N - 1)d/N & Z_{n + 1} = d \\
%                           
\textrm{global index}   & j = 1   & j = 2     & j = 3      & \cdots &
                          j                & \cdots & j = N            & j = N + 1     \\
%                           
\textrm{interior index} &         & k = 1     & k = 2      & \cdots &
                          k                & \cdots & k = N - 1        &               \\
%
};

\draw (m-1-2.north) -- (m-1-9.north);
\foreach \x in {2,3,4,6,8,9} {
    \node[circle, fill, inner sep=1pt] at (m-1-\x .north) {};
}

\end{tikzpicture}

\end{document}

在此处输入图片描述

相关内容