0

How can I draw following number line using tikz?

enter image description here

I tried taking help of Help drawing a very simple number line using TikZ but when I input numbers, they are drawn very close to each other. Any hint would be highly appreciated

  • 2
    We need to see what code you actually use and which numbers you write in. You probably want to do something like x = 4cm to scale the xyz coordinate system. – Qrrbrbirlbel Jan 25 '23 at 16:16

1 Answers1

3

Try this code:

\documentclass[10pt,a4paper]{article}

\usepackage{amsmath} \usepackage{graphicx,tikz}

\begin{document} \begin{tikzpicture} \draw[latex-latex] (-.2,0)--(10.5,0); \foreach \x in {0,1,...,10} \draw[line width=2pt] (\x,.1)--(\x,-.1) node[below] {\bfseries $\frac{\x}{4}$}; \filldraw (7,0) circle(.1) node[above] {A}; \end{tikzpicture} \end{document}

Output:

enter image description here

ADD: If You want losenges as marks consider this code;

\documentclass[10pt,a4paper]{article}

\usepackage{amsmath} \usepackage{amssymb} \usepackage{graphicx,tikz}

\begin{document} \begin{tikzpicture} \draw[latex-latex] (-.5,0)--(10.5,0); \foreach \x in {0,1,...,10}{ \draw[line width=2pt] (\x,-.1) node[below] {\bfseries $\frac{\x}{4}$}; \node at (\x,0) {\small $\blacklozenge$}; } \node at (7,.35) {A}; \end{tikzpicture} \end{document}

Output:

enter image description here

Thruston
  • 42,268