I came up with a weekly R challenge, as a way to “force” myself into learning new things. One figure, every week! The catch is that every time I should be trying something new… maybe I’ll use a new type of visualization for first time, or maybe I’ll explore a new dataset. Initially I thought it would be neat if there was some unifying topic, e.g. water, but then I decided to keep it open.

## 1st of March aka Баба Марта day!

On 1st of March, in Bulgaria, we celebrate the beginning of the spring. It’s also known as Grandma March day (bg: Баба Марта). Grandma March is moody, today the sun may be shining, but tomorrow it may snow. Eventually, when Grandma March leaves, at the end of March, the spring arrives.

Usually, on 1&st of March, we gift our closest people with martenitsa (bg: мартеница). If you’re in Bulgaria on that day (or whitin March), you can see that EVERYONE is wearing them. Lots of them. It is a lovely holiday, when you select/prepare мартеници for all your friend and family. I love wearing it as a bracelet, but the most traditional one is with two figures (male & female). The pom-poms variety is also very popular.

I truly love this holiday and miss the martenitsa exchange with my friends and family. My mom sends me martenitsa with the post each year, no matter where I live (Denmark, USA, or Singapore). I love everything about this holiday, especially those two things about martenitsa:

• it is always a gift and people put a lot of thought in selecting which ones they will buy or make and for whom (who will be gifted with it);
• it has almost no monetary value, but it has a rich symbology;

Wikipedia provides a nice intro to martenitsa, so here is a short paragraph on the symbology:

The red and white woven threads symbolize the wish for good health. They are the heralds of the coming of spring and of new life. While white as a color symbolizes purity, red is a symbol of life and passion, and so some ethnologists have proposed that, in its very origins, the custom might have reminded people of the constant cycle of life and death, the balance of good and evil, and the sorrow and happiness in human life. The Martenitsa is also a stylized symbol of Mother Nature, the white symbolizing the purity of the melting white snow and the red setting of the sun, which becomes more and more intense as spring progresses.

Apparently, martenitsa is also on the UNESCO Representative List of the Intangible Cultural Heritage of Humanity since 2017 link.

So, since I’m far away from Bulgaria, and I spend quite a lot of time online, I decided to make a digital martenitsa and to gift it to everyone I know on social media. Of course, I’m using the chance also to practice plotting things in R, so this counts as the 6th entry for my weekly challenge, which is shaping to be 14-day challenge…

## Technical details and code

I’m making pom-poms! The red color I use is the one from the Bulgarian flag (#D01C1F). I played for a while with the idea to use the green (from the flag) as a background, but it looked so bad, it almost caused me a headache. So, instead I use one of the lightest tints of the same red (#fadddd).

My digital martenitsa has 3 elements:

• pom-poms (red and white)
• ribbon
• thread connecting the pom-poms and the ribbon

The pom-poms were made out of 5000 points each, whose x and y coordinates were sampled from a normal distribution with SD=0.3 (rnorm()).
The thread is made with segments with the coordinates of the pom-pom centers (the mean of the rnorm), and the center of the ribbon (x=0, y=0).
The ribbon was the “new” thing for me this time around. I used the parametric form of the equation of the lemniscate of Bernoulli, which I learned how to plot from this amazing post from x-engineer.org: “How to plot parametric equations with Scilab”. It’s great, check it out!

And that’s it!

Happy 1st of March! Честита Баба Марта!

library(scales)
# Lemniscate of Bernoulli (parametric form) for the martenitza ribbon
t <-seq(0, 2*pi, by=0.001)
a <- 2
x <- a*sqrt(cos(2*t))*cos(t)
y <- a*sqrt(cos(2*t))*sin(t)
# generating some random points for the martenitza pom-poms
set.seed(01032019)
y.pom <- rnorm(5000, -3, 0.3)
x1.pom <- rnorm(5000, -1, 0.3)
x2.pom <- rnorm(5000, 1, 0.3)
# setting the parameters of the plot
par(mar=c(1, 1, 1, 1), bg="#fadddd", bty="n", xpd=FALSE, family="mono")
# plotting it all!
plot(x,y, type="l", col="#D01C1F", lwd=3, axes=FALSE, xlim=c(-4,4), ylim=c(-5,5))
lines(x, y, col="#FFFFFF", lty=2, lwd=2)
points(0, 0, col="#D01C1F", lwd=3, cex=2)
segments(0, 0, -1, -3, col="#D01C1F", lwd=3)
segments(0, 0, -1, -3, col="#FFFFFF", lty=2, lwd=2)
segments(0, 0, 1, -3, col="#D01C1F", lwd=3)
segments(0, 0, 1, -3, col="#FFFFFF", lty=2, lwd=2)
points(x1.pom, y.pom, col=alpha("#D01C1F", 0.5), pch=16)
points(x2.pom, y.pom, col=alpha("#FFFFFF", 0.5), pch=16)
# texts
text(0, 4, "Честита Баба Марта!", col="#D01C1F", cex=4)
mtext("@DenitzaV", side=1, line=0, adj = 1, col="#D01C1F")