使用 TikZ 绘制这样的网格

使用 TikZ 绘制这样的网格

我对 TikZ 还很陌生,而且我对基础知识还有些了解...我正在尝试渲染此图像: 一只忙碌的猫

有没有简单的方法来绘制这些要点?另外,是否可以在箭头周围添加两条曲线?提前致谢。

答案1

实现这一点的方法(通常)有多种,下面我展示了一种使用两个循环的方法。稍微调整一下就可以制作出左边的线条和箭头。

在此处输入图片描述

\documentclass[tikz,border=4mm]{standalone}
\begin{document}
\begin{tikzpicture}[>=stealth]
% draw axis lines
\draw [->] (-0.5,0) -- (5,0) node[below]{$n$};
\draw [->] (0,-0.5) -- (0,3) node[left]{$k$};

% place bullets
\foreach \x in {0,1,2,3}
  \foreach \y in {0,0.2,...,2}
     \fill (\x,\y) circle[radius=2pt];

% place ticklabels below x-axis
\foreach \x/\txt in {1/L,2/2L,3/3L}
   \node [below] at (\x,0) {$\txt$};

% place ticklabel for y-axis
\node [left] at (0,2) {$N-1$};

% place 2pi/n-node left of axis
\node [left=1.4cm,inner xsep=0pt] (A) at (0,1) {$\frac{2\pi}{n}$};

% dots on the far right
\node at (4,1) {$\dots$};

% draw lines from fourth and fifth bullet to a coordinate relative to the 2pi/n node
% (vertical separation of bullets is 0.2)
\draw (0, 4*0.2) to[out=180,in=0] ([yshift=-0.5cm,xshift=2pt]A.south west);
\draw (0, 5*0.2) to[out=180,in=0] ([yshift=0.5cm,xshift=2pt]A.north west);

% draw arrows
\draw [->] (A.north) -- ++(0,0.5cm);
\draw [->] (A.south) -- ++(0,-0.5cm);
\end{tikzpicture}
\end{document}

相关内容