我想学习 tikz,但由于我无法看到坐标,所以我需要在帮助线上绘制/显示步骤编号。我该如何实现?
\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw[help lines, color=red!40, dashed, xstep=0.5cm,ystep=0.5cm] (-9.9,-9.9) grid (9.9,9.9);
\draw[<->,ultra thin] (-9,0)--(9,0) node[right]{$x$};
\draw[<->,ultra thin] (0,-9)--(0,9) node[above]{$y$};.
\end{tikzpicture}
\end{document}
答案1
如果你想要这样的东西:
然后仅添加两行额外行\begin{tikzpicture}...\end{tikzpicture}
。
\tkzInit[xmax=10,ymax=10,xmin=-10,ymin=-10]
%\tkzGrid
\tkzAxeXY
当然使用\usepackage{tkz-euclide}
。
完整示例:
\documentclass{standalone}
\usepackage{tkz-euclide}
\begin{document}
\begin{tikzpicture}
\tkzInit[xmax=10,ymax=10,xmin=-10,ymin=-10]
%\tkzGrid
\tkzAxeXY
\draw[help lines, color=red!40, dashed, xstep=0.5cm,ystep=0.5cm] (-9.9,-9.9) grid (9.9,9.9);
\draw[<->,ultra thin, step=1cm] (-9,0)--(9,0) node[right]{$x$};
\draw[<->,ultra thin] (0,-9)--(0,9) node[above]{$y$};.
\end{tikzpicture}
\end{document}
更新:
\documentclass{standalone}
\usepackage{tkz-euclide}
\begin{document}
\begin{tikzpicture}
\tkzInit[xmax=10,ymax=10,xmin=-10,ymin=-10]
%\tkzGrid
\tkzAxeXY
\draw[help lines, color=red!40, dashed, xstep=0.5cm,ystep=0.5cm] (-9.9,-9.9) grid (9.9,9.9);
\draw[<->,ultra thin, step=1cm] (-9,0)--(9,0) node[right]{$x$};
\draw[<->,ultra thin] (0,-9)--(0,9) node[above]{$y$};.
\end{tikzpicture}
\end{document}