با کمک بسته tikz میتونین این شکل رو به راحتی در لاتک رسم کنین. کد پایین رو ببینین:
\documentclass{article}
\usepackage{tikz}
\usepackage{xepersian}
\settextfont{Yas}
\setdigitfont{Yas}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}[>=Stealth, thick]
\draw[->] (-1.5,0) -- (6.5,0);
\foreach \x in {-1, 0, 1, 2, 3, 4} {
\draw (\x, 0.1) -- (\x, -0.1);
\node[below=3pt] at (\x, 0) {$\x$};
}
\draw[red] (-1, .2) -- (4, .2);
\node[red] at (0, 0.4) {A};
\draw[red, fill=white] (-1, .2) circle (3pt);
\draw[red, fill=red] (4, .2) circle (3pt);
\draw[green!60!black] (2, .4) -- (5.8, .4);
\node[green!60!black] at (3, 0.6) {B};
\draw[green!60!black, fill=white] (2, .4) circle (3pt);
\end{tikzpicture}
\end{document}
خروجی:
