# The Mondrianomies

**R | Fronkonstin**, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)

Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

The Moonies are up on their mountain, the lunatics have taken over the asylum, waiting on the rapture (The Daily Mail, Radiohead)

I have not write any post lately, maybe because I have been quite busy with other unexpected project or maybe because I am going through a deep creative crisis. Whatever the reason, I have decided to resume my activity with Fronkonstin. Paraphrasing Picasso, *inspiration will find me working when it comes*.

Mondrianomies are the evolution of this previous project. To adapt outputs to neoplasticism assumptions I only use right angles and primary colors. This is why they remind the work of the founder of neoplasticism: Piet Mondrian. This is an example:

Mondrianomies are based on L-systems, a formalism invented in 1968 by the biologist Aristid Lindenmayer that yields a mathematical description of plant growth. Concretely, Mondrianomies have the following characeristics:

- Use these five actions:
`F`

(draw a segment),`+`

(turn right),`-`

(turn left),`[`

(save the current position and angle for later use onto a stack of saved states) and`]`

(remove the last saved state from the stack and use it to restore the last saved position and angle). - Start with the axiom
`F-F-F-F`

(i.e.*draw a segment, turn left, draw a segment, turn left, draw a segment, turn left and draw a segment*). - Only have a rule, randomly generated from the actions. The rule is applied a number of times (3 or 4) to substitute the action
`F`

(starting from the axiom) and therefore expanding the list of actions to generate the drawing. - Turning angle is 90 degrees.
- Longitude of segments depends on how many segments have been drawn previously.

Here you have four more outputs of this system. Do not hesitate to modify its parameters to obtain quite diverse images like these:

The code is available at github. There are many *parts* to play with: the axiom, the angle, the colors … you can even invent new actions to sofisticate the output. Create your own artworks and enjoy the journey.

**leave a comment**for the author, please follow the link and comment on their blog:

**R | Fronkonstin**.

R-bloggers.com offers

**daily e-mail updates**about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.

Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.