答案1
我认为edge[]
这就是你正在寻找的:
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[scale=0.5]
\draw[ blue] (-6,0)-- +(0:11cm) edge[green] +(0:6cm) edge[red] (9,0);
\foreach \x in {0,5} {
\draw (\x,0.5) -- (\x,-0.5) node[below] {\x};
}
\draw[] (5,0) circle (0.5);
\end{tikzpicture}
\end{document}