Results

Q1: Which are the most dominant colors in the flags for countries in each continent?

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.




Q2: How many distinct colors we need to represent all the flags?

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.




Q3: How can we present flags worldwide within eight colors?

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.

  • The flag of India:
  • The flag of Uganda:
  • The flag of USA:
  • The flag of Fiji:



  • Q4: Are coastal countries more likely to have blue on their flags?

    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.




    Q5: Agriculture vs. Green

    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.




    Q6: What kinds of patterns do they have on the flags for countries in each continent?

    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.




    Q7: Is this a Muslim country?

    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.




    Q8: What are the characteristics of national flags in Arab World?

    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.




    Q9: The history of Pan-Slavic colors.

    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.




    Q10: A visualization of countries and their flags in Africa.

    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.