Answers for "tikz number line"

0

tikz number line

\documentclass[border=2pt]{standalone}
\usepackage{pgfplots}
\begin{document}
    \begin{tikzpicture}
        \begin{axis}[
            % center the x axis
            axis x line=middle,
            % we don't need a y axis line ...
            axis y line=none,
            % ... and thus there is no need for much `height' of the axis
            height=50pt,
            % but `height' also changes `width' which is restored here
            width=\axisdefaultwidth,
            xmin=-3,
            xmax=3,
        ]
            \addplot coordinates {
                (0.5,0) (0.7,0) (0.9,0)
            };
        \end{axis}
    \end{tikzpicture}
\end{document}
Posted by: Guest on October-04-2021

Browse Popular Code Answers by Language