答案1
使用包中的 pattern
库:positioning
tikz
\documentclass[tikz, margin=3mm]{standalone}
\usetikzlibrary{patterns, positioning}
\begin{document}
\begin{tikzpicture}[
dot/.style = {circle, fill, inner sep=2pt, node contents={}}
]
\path[pattern=north east lines] (0,-1) rectangle (1,1);
\draw (-3,0) -- (-2,0) node (a) [dot]
-- ( 0,0) node [dot]
-- ( 2,0) node (b) [dot]
-- (3,0);
\draw (0,1) -- (0,-1) coordinate (aux);
\path (a |- aux) node[below] {$Z_{P\hat{N}}$}
(aux) node[below] {$Z_{P\hat{N}+1}$}
(b |- aux) node[below] {$Z_{P\hat{N}+2}$};
\end{tikzpicture}
\end{document}