我想画绿点但是下面的尝试失败了。
\documentclass[border=1cm]{standalone}
\usepackage{tikz}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[]
\foreach \i in {1,...,10}{
\addplot[green,scatter,mark size=1pt]coordinates{(\i,0)};
\addplot[fill=green,scatter,mark size=1pt]coordinates{(\i,1)};
\addplot[color=green,scatter,mark size=1pt]coordinates{(\i,2)};
}
\end{axis}
\end{tikzpicture}
\end{document}
下一步我该做什么?
答案1
删除scatter
和添加only marks
\documentclass[border=1cm]{standalone}
\usepackage{tikz}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[]
\foreach \i in {1,...,10}{
\addplot[color=green,only marks,mark size=1pt]coordinates{(\i,2)};
%\addplot[color=green,scatter,mark size=1pt]coordinates{(\i,2)};
}
\end{axis}
\end{tikzpicture}
\end{document}