What's the code to list all the world's flags?
CountryData["G8", "Flag"]
works to get those particular flags, but what about all the world's flags?
CountryData["World", "Flag"]
(* Missing["NotApplicable"] *)
This works, but seems contrived; is there a shortcut?
CountryData[#, "Flag"] & /@ CountryData[]
More importantly, is it possible to insert the flags as ChartLabels
in, say, BarChart
?
EDIT:
Following up on Mr. Wizard's solution, I find that some flags, when inserted as ChartLabels
, are shifted down:
The rule used to create the flags is:
# -> Image[CountryData[#, "Flag"], ImageSize -> {15, 20}] & /@
CountryData[];
which is necessary in this application since the data is associated to country code.
The code to generate the bar chart is somewhat lengthy and irrelevant, but essentially, it just calls ChartLabels
to insert the images.
Any idea why Philippines and United Kingdom are translated downwards?
A related question is how to rotate the flags $90^\circ$ to render the BarChart
on its side.