0

dI would like to draw the following number line where N is just a fixed number

and B1 is the set {1,...,N} etc.

enter image description here

Although i searched and found somes codes displaying similar lines using tikz

i couldnt adjust the proper modifications. Any help would be appreciated , thanks in advance!

2

This could be a starting point:

\documentclass[border=3mm]{standalone}

\usepackage{tikz}


\begin{document}

\begin{tikzpicture}[xscale=1.2,font=\footnotesize]
\draw (0,0) -- (12,0);
%
\foreach\m/\n in {0/1,3/N,4/N+1,7/2N,8/2N+1,11/3N}
    {\node[scale=.7] at (\m,0) {$|$};
     \node[below,yshift=-5pt] at (\m,0) {$\n$};}
%
\path
    node[above] at (1.5,0) {$B_1$}
    node[above] at (5.5,0) {$B_2$}
    node[above] at (9.5,0) {$B_3$};
\end{tikzpicture}

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.