我使用这个绘制坐标平面
\begin{tikzpicture}
\draw[thin,->] (-3.5,0) -- (4.5,0) node[anchor=west] {x};
\draw[thin,->] (0,-3.5) -- (0,4.5) node[anchor=south] {y};
\foreach \x in {-3,-2,-1,0,1,2,3,4}
\draw (\x cm,2pt) -- (\x cm,-2pt);
\foreach \y in {-3,-2,-1,0,1,2,3,4}
\draw (2pt, \y cm) -- (-2pt, \y cm);
\end{tikzpicture}
现在我想在点 (0,0)、(0,2)、(2,0)、(1,1) 上绘制几个黑点。我该怎么做?我还希望可以改变点的半径。
答案1
这是使用常规 Tikz 的解决方案。如果您想更改点的大小,可以这样做。但“如何”可能因您希望它们如何更改而有所不同。
输出
代码
\documentclass[margin=10pt]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw[thin,->] (-3.5,0) -- (4.5,0) node[right] {$x$};
\draw[thin,->] (0,-3.5) -- (0,4.5) node[above] {$y$};
\foreach \x [count=\xi starting from 0] in {-3,-2,-1,,1,2,3,4}{% ticks
\draw (\x,2pt) -- (\x,-2pt);
\draw (2pt,\x) -- (-2pt,\x);
\ifodd\xi
\node[anchor=north] at (\x,0) {$\x$};
\node[anchor=east] at (0,\x) {$\x$};
\fi
}
\foreach \point in {(0,0),(0,2),(2,0),(1,1)}{% points
\fill \point circle (2pt);
}
\end{tikzpicture}
\end{document}