Exploring the Art hidden in Pi

Posted: January 24, 2015-Likes: 0-Comments: 6-Categories: Data Art, R-Tags: Data art, Illustrator, R
You are here: ...
Home / Blog / Data Art / Exploring the Art hidden in Pi
While browsing online I came across several examples of Martin Krzywinski’s Pi art works and I was inspired to try and do a small project with the digits. I wanted to try and create something that wasn’t very informative per se, but hopefully pretty to look at, more like Art.
And I always like art that has its roots in Nature (such as we see from many beautiful Hubble photos of the Universe, microscopic photographs of Vitamins or close-ups of the heart of a Sun Flower to name just a few)

The first 1000 digits

Using the digits I could create steps in a 2D field where the direction is defined by the number. Starting from the 3 at (0,0), the first step would be 36 degrees from the zero, which I defined to be straight up (see the legend in the image below for a better explanation).
Although this idea has been around for quite some time (In The Logic of Chance (1888), the mathematician John Venn suggested that the digits 0 to 7 represent eight compass directions, and he followed the path tracked by these digits in pi) I just wanted to play around with it myself.I colored the lines according to the step direction, but experimented a lot with different color palettes and background colors. Most of the examples I saw used a black background which really gives the colors a pop. Eventually I decided to just stick with a no-frills white background and a more classic color wheel palette, since being able to tell all the colors apart exactly isn’t really the purpose (and besides you can use the angle to read of the value of the digit)
I used R to calculate all the positions, ggplot2 to visualize the resulting path and colors, exported this to a pdf and finished it in Illustrator with a legend and combining plots into one

Beyond 1000

For the orders of 1e4 and bigger the above approach wasn’t creating interesting results anymore because the walked path became so much bigger than the length of one step, thus the result for 10000 digits looked like a colorful pixel explosion.
Also I became more interested in seeing how the numbers walked from start to finish than the digits themselves. Therefore I reused the color scale from the image above but now let it spread out over all the digits used.

Although R and ggplot could still handle the million digits plot, Illustrator wasn’t able to read any of the vector based outputs I created in R, so I just had to be content with a rather big jpegI find it very interesting to see how the shape of, say, 1000 digits gives you no clue how the shape of one order bigger is going to look, seeing the randomness of pi visualized I guess

The Art in Errors

Of course some of my first plots in ggplot weren’t doing what I thought they should. However, some of these resulted in nice looking images nonetheless, like the one below. Here I wanted to color the lines according to the digit number, but instead I ended up creating 10 different lines where each line connects the digit locations of one specific digit

More examples of art created with pi can be found on the Pi-day coverage of the Guardian

Edit: You can find the R script to create the path and some images here: https://github.com/nbremer/artinpi

Prev / Next Post
Comments (6)
  • nlo - January 25, 2015 - Reply

    Love this. Had thought of (and carried it out, manually, which is more or less useless/time consuming) something similar to this, but not as pi. Nevertheless as a way to see a randomized ‘painting’ to include randomizing color and other aspects of the direction (size and so forth). Love what you came up with. Perhaps the code can be put up?

  • Nicholas Davis - March 30, 2015 - Reply

    I see that you decided not to post my comment that I submitted around when this project was featured on Washington Post’s recent (2015) Pi Day data art article about how extremely similar this data art project is to Brannon Dorsey’s “Vector Pi” project made a year prior. Perhaps that is because you went through a change in your website or, perhaps, for other administrative reasons. In any case, I sincerely hope that you consider, at the very least, to publicly acknowledge the extreme similarities of the yours and Brannon’s aforementioned project simply out of respect for “incidental” kinship.

    https://brannondorsey.com/work/vectorpi

    • Nicholas Davis - March 30, 2015 - Reply

      _Edit_
      Last sentence:
      In any case, I sincerely hope that you consider, at the very least, to publicly acknowledge the extreme similarities of your project and Brannon’s aforementioned project simply out of respect for “incidental” kinship.

      • Nadieh
        (Author) Nadieh - March 30, 2015 - Reply

        Hello Nicholas,

        I’m sorry, I did go through a host change which took my about 2 weeks to transfer and lost a comment or two in those weeks :(
        I looked at Brannons work (I have not seen it before) and indeed he uses a similar idea to what I do, only he does this with words and position in the alphabet to define the next angle to step in, whereas I use digits. But I very much like his idea to turn words into numbers into Art :)
        However, if I read his work correctly, he actually does not visualize Pi in itself, only words from books (perhaps the work is called Vector Pi because the formula to define the next step angle is inspired by a circle). As I mentioned in my post, I’m definitely not the first one to even use digits of pi to step, although I couldn’t find another example which keeps pi in the “regular” base 10 (but if anyone finds an example I’d love to see their version :) )

  • M Saumure - November 13, 2016 - Reply

    At 10 000 the strands look tantalizingly like complex proteins. Thank you for these beautiful images.

Add comment

1 × 1 =