答案1
我稍微修改了你的坐标,以便图形更适合你的文档。如果不合适,只需更改代码中的坐标即可。
你可以简单地将字符串添加到 Ti钾通过一个简单的命令来Z图片\draw
:
\draw (<x>,<y>) node {<string>};
可以添加一些选项,例如
\draw (<x>,<y>) node[left=0.5cm] {<string>};
例如,这是您的图表:
\documentclass[tikz, border=3mm]{standalone}
\begin{document}
\begin{tikzpicture}
\draw (0,0) -- (6,0);
\draw (2,-0.1) -- (2,0.1);
\draw (4,-0.1) -- (4,0.1);
\draw (2,0) node[below=1ex] {$-3$};
\draw (4,0) node[below=1ex] {$-6$};
\begin{scope}[red] % For local settings -- thanks to @marmot's comment
\draw (1,0) node[above] {$+$};
\draw (3,0) node[above] {$-$};
\draw (5,0) node[above] {$+$};
\end{scope}
\end{tikzpicture}
\end{document}