5

I have drawn a timeline using following answer for How draw multiple timelines one after another. Is it possible to add horizontal curly braces under the timeline along with its label?

Desired sketch is as follows:

enter image description here


code for an example timeline:

\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){} -- (11,0) node (b) {} ; \foreach \x [count=\i] in {0,50,...,500} { \def \inBetSpace {1} \draw[line width=1pt] (\i*\inBetSpace-\inBetSpace,-2mm) nodebelow {\x} -- ++(0,4mm); } \end{tikzpicture} \end{document}

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

1 Answers1

6

enter image description here

\documentclass[tikz, margin=3mm]{standalone}
\usepackage{siunitx}
\usetikzlibrary{positioning,calc, arrows.meta}
\usetikzlibrary{decorations.pathreplacing}

\begin{document} \begin{tikzpicture} \draw[->, -Latex, line width=1pt] (0,0)node(a){} -- (11,0) node (b) {} ; \foreach \x [count=\i] in {0,50,...,500} { \def \inBetSpace {1} \draw[line width=1pt] (\i*\inBetSpace-\inBetSpace,-2mm) nodebelow {\x} -- ++(0,4mm); } \draw[decorate, decoration={brace, amplitude=6pt},] ([yshift=-1cm]2.95,0)-- node[below=0.25cm] {Label-1}([yshift=-1cm]a.center); \draw[decorate, decoration={brace, amplitude=6pt},] ([yshift=-1cm]9,0)-- node[below=0.25cm] {Label-2}([yshift=-1cm]3.05,0); \end{tikzpicture} \end{document}

EDIT using font size \tiny and \scriptsize with font \texttt

\documentclass[tikz, margin=3mm]{standalone}
\usepackage{siunitx}
\usetikzlibrary{positioning,calc, arrows.meta}
\usetikzlibrary{decorations.pathreplacing}

\begin{document} \begin{tikzpicture} \draw[->, -Latex, line width=1pt] (0,0)node(a){} -- (11,0) node (b) {} ; \foreach \x [count=\i] in {0,50,...,500} { \def \inBetSpace {1} \draw[line width=1pt] (\i*\inBetSpace-\inBetSpace,-2mm) nodebelow {\x} -- ++(0,4mm); } \draw[decorate, decoration={brace, amplitude=6pt},] ([yshift=-1cm]2.95,0)-- node[below=0.25cm] {\texttt{\tiny Label-1}}([yshift=-1cm]a.center); \draw[decorate, decoration={brace, amplitude=6pt},] ([yshift=-1cm]9,0)-- node[below=0.25cm] {\scriptsize Label-2}([yshift=-1cm]3.05,0); \end{tikzpicture} \end{document}

enter image description here

js bibra
  • 21,280