# Best tool to generate cashflow diagrams

I often have to generate cashflow diagrams.

I was wondering if anyone has a good tool to generate them in either $\LaTeX$ or a picture?

-

I found a nice example on this page using the pgf/tikZ package for $\LaTeX$.

The website is giving the code for $\LaTeX$, if you are using LyX, in order to get the same sample than the website you have to do the following. First edit the document preamble using Document->Settings:

 \usepackage{siunitx}
\usepackage{tikz}
\usetikzlibrary{calc,matrix}


and then the following in a code block:

 \begin{tikzpicture}[>=stealth,ultra thick]
\draw[->] (0,0) -- (10,0);
\draw (-1,0) node[below] {n} (-1,0.5) node[above] {PMT};
\foreach \x/\n in {1/0,3/1,5/2,7/3,9/4}
\draw (\x,0) node(\n)[below] {\n} -- (\x,0.5);
\foreach \x/\n in {1/0,3/1,5/2,7/3}
\draw (\x,0.5) node[above] {\num{5000}};
\matrix (calc) [matrix of math nodes,matrix anchor=north west,nodes={anchor=east}] at (9,-1) {%
\$\num{5300.00} & = & \num{5000}\times (\num{1.06})^1 \\ \$ \num{5618.00} & = & \num{5000}\times (\num{1.06})^2 \\
\$\num{5955.08} & = & \num{5000}\times (\num{1.06})^3 \\ \$ \num{6312.38} & = & \num{5000}\times (\num{1.06})^4 \\
\$\num{23185.46} \\ }; \draw[thick] (calc-5-1.north west) -- (calc-5-1.north east); \foreach \n/\l in {0/4,1/3,2/2,3/1} \draw[->,gray!50] (\n) |- ($(calc-\l-1.west)+(-0.5,0)$); \end{tikzpicture}  - Why do you think this requires LyX? – chrisaycock Apr 16 '13 at 12:50 It does not, I just gave the steps to use it with LyX, will edit to clarify. I put the steps for$LyX$because I know many people who are not familiar with working directly with$\LaTeX\$ files. – BlueTrin Apr 16 '13 at 12:51

Aside from TikZ approach that you've found, these scripting languages would work:

• MetaPost
• PSTricks
• Asymptote
• MATLAB, see cfplot
• Mathematica, see Cashflow

Vector graphics are most suitable for the task, so if you prefer GUI point-and-click: