Pi an experiment with circlize package

 Pi to 1000 places connected

Idea:

In the past i have often observed circular plots (cant find a technical name) in

1) New York times[1] to display human genome data
2) Migration patterns among humans[2]
3) to display import and export data (Bloomberg terminal).
4) Mathematical art [3]

My understanding of these circular plots is very new but considering the popularity of these plots i believe it would be unjust not to discuss them on my blog. This post is motivated by an Instagram image of a similar plot created using circos software[4]. The image is created using pi numbers upto 1000 decimal places and connecting the consecutive numbers. We know the value of pi is 3.141…. and the visualization is generated by connecting 3 to 1, 1 to 4, 4 to 1 and so on. We all know numbers in a pi are random and follow no particular order but we see a sort of an image emerge over here. A structure in random values.

Data:

The data file was created by copying and pasting pi numbers from here. You would observe that copying and pasting values from web into excel is a problem but i prefer using csv format and hence i had no other choice. I further tidied the data using the =left() and = right() functions to display the values in one column.copied them to the next column. In case you like to access the file it is here .

Code:

install.packages(“circlize”)

library(“circlize”)
circos.par(gap.degree = 3)
colors= c(“#542D15″,”#C07F4D”, “#4B2078″,”#C153C9″,”#0A6A6C”,”#1DCEC6″,”#094AA5″,”#0181FD”,”white”,”#92B966″ )
chordDiagram(pi, grid.col= colors, grid.border=c(“white”),transparency=0.5)