# How to draw a binomial option tree graph?

I am writing a paper and need to create a png or jpeg file for binomial option price tree.

In the past I would have used the tikZ package in LaTeX, but that won't work in this case.

So I want a different package than LaTeX/Tikz to draw this graph, possibly in R, python, ....

Can you help?

• Hi TJB, welcome to quant.SE! I would transfer this to tex.stackexchange.com but you have to show more work or they will just close it. So I will close it here and suggest you try again there. – Bob Jansen Sep 4 '14 at 23:18
• See above, here its off topic, they will probably close for lack of detail. – Bob Jansen Sep 4 '14 at 23:20
• I am trying to avoid using LaTeX for this project. Instead I would like to know how to do it with R, Python, Matlab, Gnuplot or anything of the kind. Where should I go with that question? – TJB Sep 4 '14 at 23:21
• Aha, so you want to create nice graphics in something else than Tikz? I misunderstood, doubting this one is really on-topic but I'll let the community decide as it might be of interest. For now, have you looked at GraphViz? – Bob Jansen Sep 4 '14 at 23:26
• @BobJansen I'll take a look at GraphViz. Thanks! – TJB Sep 4 '14 at 23:30

In R you can use fOptions package to draw Binomial Tree graphs.

Here is a simple code snippet

#Install the package and load it
install.packages('fOptions')
library(fOptions)

#Calculate the value of the option and plot
optionVals<-BinomialTreeOption(TypeFlag="ce",S=100,X=100,Time=3,r=0.05,b=0,sigma=0.2,n=3,title="example binomial tree")
BinomialTreePlot(optionVals)


The output is given below (I don't know maybe it can be done more beautifully, this is the default).