2

Trying to draw a 1D plot, some dots over one X axis. Currently, I have:

\begin{tikzpicture}
\begin{axis}[
xmin=0, xmax=22,
axis x line=bottom,% only show the bottom x axis
hide y axis,    
scatter/classes={%
    a={mark=o,draw=black}}
]

\addplot[scatter,only marks,
    mark size = 3pt,
    fill = red,
    scatter src=explicit symbolic]
table {
3 0 
6 0 
9 0 
12 0 
15 0 
18 0 
    };
\end{axis}

\end{tikzpicture}

unfortunately, the circles doesn't appears over (superposed) the x-axis. This is what I see:

enter image description here Any hint or some solution more simple?

1 Answers1

3

You need to add a y minimum and maximum.

Code:

\documentclass{amsart}
\usepackage{pgfplots}
\begin{document}

\begin{tikzpicture}
\begin{axis}[
    xmin=0, xmax=22,
    axis x line=bottom,% only show the bottom x axis
    hide y axis,    
    ymin=0,ymax=5,
    scatter/classes={%
        a={mark=o,draw=black}}
    ]

\addplot[scatter,only marks,
    mark size = 3pt,
    fill = red,
    scatter src=explicit symbolic]
table {
3 0 
6 0 
9 0 
12 0 
15 0 
18 0 
    };
\end{axis}

\end{tikzpicture}

\end{document} 

This yields:

enter image description here

Dan
  • 3,699