We showed the percentages of dominated colors for six continents (excluding Antarctica). We surprisingly found that Europe has 49% red and North America is 48% blue. It does make sense that Asia is dominated by red and Oceania has such a high percentage of blue as 55%. In Africa, red, green, and yellow are the top three main hues in flags, which constitute 81% of samples. According to the observation, we assume that countries with longer coastlines will more likely to have blue on their flags. Green is a common color used in Muslim countries. In addition, some countries that locate in desert areas in Africa may also have green in their national flags. Green represents hope and forest.
We created a table with R,G,B columns using pixels from all the flags and used k-means clustering to identify their main colors. The graph below shows that it is appropriate to classify the pixels to 8 clusters. We made a k-means model and found out 8 dominant colors, which are yellow, navy, white, green, black, cerulean, and sapphire. The result was consistent with the records of our flag data. Then we could use these 8 colors to represent all the flags and drew simpler versions of the flags.
According the KMeans plot mentioned above, we chose eight clusters of color to represent all the colors used in national flags. The eight colors are shown below:
To see how well those colors can represent flags, we plot some flags with these eight colors. All orange or gold colors are generalized as yellow.
On the flags, blue symbolizes the sky and the sea. According to our calculation, for all the countries which have blue on their national flag, around 80% are coastal countries. So we were guessing that countries with longer coastlines would more likely to have blue on their flags. We did a linear regression on the percentage of coast to area of each country and the percentage of blue color on each flag. This resulted in a weak positive relationship with coefficient equals to 0.19.
On the flags, green is related with land and agriculture. Besides muslim countries, we assume that countries which rely on agricultural production are more likely to have green on their flags. Thus, we did a linear regression on the percentage of agriculture product to domestic product and the percentage of green color on each flag. From the graph, we can see that it is hard to say there is a linear relationship between the two variables, and coefficient equals to 0.11.
From this stacked bar plot, we can find that sun and star symbols are the most popular patterns among all continents, since sun means freedom and stars are mostly used to represent states, province or other political motives. Crescent is the symbol of Muslim so only some counties in Africa and Asia have crescents on their national flags. Icons are inanimate images such as weapons ,constructions and map. Animate images are plants, animals or humans. The most commonly see animal is the eagle and the most popular plant is laurel.
Since crescent and color green are the symbols of Muslim countries, we used dummy variables "crescent" and "green" to do a logistic regression and predicted whether a country's religion was muslim or not. In the prediction, "1" means it is a Muslim country and "0" means it's not. Among 36 muslim countries, the model only found 5 countries correctly, but it successfully classified 158 countries which are not Muslim. Thus, the balanced accuracy score is 0.5694.
According to the information on Wikipedia, the Arab world consists of 22 Arabic-speaking countries. The region covers from the Arabian Peninsula to north Africa. The dominant religion in this area is Islam. We visualized 16 countries and their national flags in this region. From the graph, we can see that the most frequently combination is red, green, white, and black. We can also find the crescent symbol on some countries flags, which suggests that Islam is the major religion in these countries.
The Pan-Slavic colors were the three colors from the flag of Russia, namely red, blue, and white. Historically, countries in Slavic nations have those tree colors on their flags.We plotted six countries that are existent today, which were former Pan-Slavic countries.
Red, gold, green, and balck are the most common colors in flags of African countries. A set of red, gold, green colors is originated from the flag of Ethiopia. A combination of red, black, and green sometimes presents black nationalism or black liberation (Wikipedia). Below is an animation of some countries and their national flags in Africa.