0

I am using this answer to draw a timeline. Is it possible to draw the following line?

         |--------|--------|--------|--------|--------|--------|--------|----->
block # 100      150      200      250      300      350      400      450   
         |-----------------|---------------||---------|--------|--------|

where it will increase by N(greater than 1).

When I try \noindent\begin{markschronology}[50]{100}{600}{\textwidth} from the solution it does not draw a proper line.


I have also tried this code which does not draw horizontal lines:

\documentclass{article}
\usepackage{chronology}
\begin{document}

\begin{chronology}[50]{100}{600}{3ex}[\textwidth] \end{chronology}

\end{document}


Example sketch:

enter image description here

Ingmar
  • 6,690
  • 5
  • 26
  • 47
alper
  • 1,389

1 Answers1

2

enter image description here

\documentclass[tikz, margin=3mm]{standalone}
\usepackage{siunitx}
\usetikzlibrary{positioning,calc, arrows.meta}
\begin{document}
    \begin{tikzpicture}
        \draw[->, -Latex, line width=1pt] (0,0)node(a){} -- (12,0) node (b) {} ;
        \foreach \x [count=\i] in {100,150,...,450,}%
        {
            \draw[line width=1pt] (\i*1.3,-2mm) node[below](n\i) {\x} -- ++(0,4mm);
        }
\draw[->, -Latex, line width=1pt] (0,-1.5cm)node(a){} -- (12,-1.5cm) node (b) {} ;
\draw[line width=1pt] (n1) ++(0,-1.25cm)--++(0,4mm);
\draw[line width=1pt] (n3) ++(0,-1.25cm)--++(0,4mm);
\draw[line width=1pt] (n6) ++(0,-1.25cm)--++(0,4mm);
\draw[line width=1pt] (n7) ++(0,-1.25cm)--++(0,4mm);
\draw[line width=1pt] (n8) ++(0,-1.25cm)--++(0,4mm);
\draw[line width=1pt] (n5) ++(0,-1.25cm)--++(0,4mm);
\draw[line width=1pt] (n5) ++(2pt,-1.25cm)--++(0,4mm);  

\end{tikzpicture} \end{document}

EDIT

\documentclass[tikz, margin=3mm]{standalone}
\usepackage{siunitx}
\usetikzlibrary{positioning,calc, arrows.meta}
\begin{document}
    \begin{tikzpicture}
        \draw[->, -Latex, line width=1pt] (0,0)node(a){} -- (12,0) node (b) {} ;
        \foreach \x [count=\i] in {100,150,...,450,}%
        {
            \draw[line width=1pt] (\i*1.3,-2mm) node[below](n\i) {\x} -- ++(0,4mm);
        }
\draw[ line width=1pt, red] (0,-1.5cm)node(a){} -- (12,-1.5cm) node (b) {} ;
\draw[line width=1pt] (n1) ++(0,-1.25cm)--++(0,2mm);
\draw[line width=1pt] (n3) ++(0,-1.25cm)--++(0,4mm);
\draw[line width=1pt] (n6) ++(0,-1.25cm)--++(0,4mm);
\draw[line width=1pt] (n7) ++(0,-1.25cm)--++(0,4mm);
\draw[line width=1pt] (n8) ++(0,-1.25cm)--++(0,4mm);
\draw[line width=1pt] (n5) ++(0,-1.25cm)--++(0,4mm);
\draw[line width=1pt] (n5) ++(2pt,-1.25cm)--++(0,4mm);  

\end{tikzpicture} \end{document}

enter image description here

js bibra
  • 21,280
  • @alper please see if the answer suits the requirement – js bibra Feb 23 '21 at 09:50
  • Can we color the bottom timelines? Can the arrow section be discarded on the bottom timeline line? Can the | on top of each section be halfed like on your answer on top of 0.5? – alper Feb 23 '21 at 12:40
  • @alper see edit -- for color add red blue color of choice -- remove arrow by removing -> -- for removing top portion of ticks edit code as follows -- \draw[line width=1pt] (n1) ++(0,-1.25cm)--++(0,2mm); -- instead of 4mm i have replaced with 2mm – js bibra Feb 23 '21 at 12:48
  • Can we also draw iterative two seperate lines below one after each other that has different colors – alper Mar 04 '21 at 22:44