0

With this code,

\begin{tikzpicture}
  \draw[line width=1pt] (0,0) -- (12,0)node[right=4mm]{(periods)};
  \foreach \x/\y in {18000/0,19080/1,20224.80/2,21438.29/3}%
  {
  \draw[line width=1pt] (4*\y,-2mm) node[below] {\y} -- ++(0,4mm) node[above] {\$ \num{\x}};
  }
  \draw[-latex] (2,-7mm) -- +(0,-10mm)node[below]{\$ \textbf{18,000}*0.06 = \$1,080};
  \draw[-latex] (6,-7mm) -- +(0,-20mm)node[below]{\$ \textbf{19,080}*0.06 = \$1,144.80};
  \draw[-latex] (10,-7mm) -- +(0,-10mm)node[below]{\$ \textbf{20224.80}*0.06 = \$1,213.49};
\end{tikzpicture}

I have the following timeline: enter image description here

However, I want to convert this annual compound to semi-annual compound with total 6 interest charged between 0 and 1/2, 1/2 and 1, ..., 2 1/2 and 3 displaying below the line by dividing each segment into two. I still want to display amount at the end of each year, so amount above the time line should be : $18,000, $19,096.20, $20,259.16, $21,492.94.

How would I obtain a such line?

Jayden Rice
  • 141
  • 1
  • 3
    Hi Jayden and welcome to TeX.SE! Can you please amend your question, so that 1. it has a MWE to be used by contributors and 2. maybe attach a hand drawing of how your result shall look like? Otherwise everything else is guess work. – TobiBS Jul 11 '20 at 12:40

1 Answers1

2

It would be better to align the interest to the left as shown to give a neater look -- now quarterly interest can be added simply by interleaving on the left side

enter image description here

\documentclass[tikz, margin=3mm]{standalone}
\usepackage{siunitx}
\usetikzlibrary{positioning,calc}
\begin{document}
\begin{tikzpicture}
  \draw[line width=1pt] (0,0)node(a){} -- (12,0)node(b){}[right=4mm];
  \foreach \x/\y in {18000/0,19000/1,20000/2,21000/3}%
{
\draw[line width=1pt] (4*\y,-2mm) node[below] {\y} -- ++(0,4mm) node[above] {\$ \num{\x}};
\node [draw]at(-0.5cm,-2cm)(p){\$ {18,000}*0.06 = \$1,080};
\node [draw,below=of p.west,anchor=west](q){\$ {19,080}*0.06 = \$1,144.80};
\node [draw,below=of q.west,anchor=west](r){\$ {20224.80}*0.06 = \$1,213.49};

\draw[-latex] ($(a)!0.16!(b)$)node[below,yshift=-12pt,fill=white]{0.5} |-(p); \draw[-latex] ($(a)!0.48!(b)$)node[below,yshift=-12pt,fill=white]{1.5} |-(q); \draw[-latex] ($(a)!0.84!(b)$)node[below,yshift=-12pt,fill=white]{2.5} |-(r); } \end{tikzpicture} \end{document}

edit---quarterly interest

enter image description here

\documentclass[tikz, margin=3mm]{standalone}
\usepackage{siunitx}
\usetikzlibrary{positioning,calc}
\begin{document}
\begin{tikzpicture}
  \draw[line width=1pt] (0,0)node(a){} -- (12,0)node(b){}[right=4mm];
  \foreach \x/\y in {18000/0,19000/1,20000/2,21000/3}%
{
\draw[line width=1pt] (4*\y,-2mm) node[below] {\y} -- ++(0,4mm) node[above] {\$ \num{\x}};
\node [draw]at(-0.5cm,-2cm)(p){\$ {18,000}*0.06 = \$1,080};
\node [draw,below=of p.west,anchor=west](q){\$ {19,080}*0.06 = \$1,144.80};
\node [draw,below=of q.west,anchor=west](r){\$ {20224.80}*0.06 = \$1,213.49};
\node [draw,below=of r.west,anchor=west](s){\$ {quarterly interest}*0.06 = \$X};

\draw[-latex] ($(a)!0.16!(b)$)node[below,yshift=-12pt,fill=white]{0.5} |-(p); \draw[-latex] ($(a)!0.48!(b)$)node[below,yshift=-12pt,fill=white]{1.5} |-(q); \draw[-latex] ($(a)!0.84!(b)$)node[below,yshift=-12pt,fill=white]{2.5} |-(r); \draw[-latex] ($(a)!0.92!(b)$)node[below,yshift=-20pt,fill=white]{2.75} |-(s); } \end{tikzpicture} \end{document}

js bibra
  • 21,280