This an example of a nice outcome that spawned from a community discussion. It all started with this tweet.
Translation: “Is there a simple MATLAB function that could easily create this animation? I want it…”
I learned that this type of animation, where the bars switch places based on the order, is called Bar Chart Race.
My colleague, Michio, replied to the tweet saying that you can do some graphical updates with the barh function.
縺薙ｌ��√→縺��≧髢｢謨ｰ縺ｯ谿句ｿｵ縺ｪ縺後ｉ遏･繧峨↑縺��ｓ縺ｧ縺吶′縲｜arh 縺ｮ繧ｪ繝悶ず繧ｧ繧ｯ繝医ｒ譖ｴ譁ｰ縺吶ｌ縺ｰ繝ｻ繝ｻ縲https://t.co/DuhjIgv6I7— michio inoue (@michio_MWJ) January 20, 2020
So, let’s see this in action. I made some modifications to Eiji’s function to include an option to display the time stamp in the title, and to reverse the order of the bars. Here is an example of the FIFA World Rankings from 1993 to 2018. The rankings are based on the data from https://www.fifa.com/fifa-world-ranking/ranking-table/men/
load data y time countries Opt.xTickLabelStrs = countries; Opt.outFileName='barchartrace_outFile.gif'; Opt.xLabelStr='Ranking'; Opt.yLabelStr='Country'; Opt.titleStr='FIFA World Ranking'; Opt.faceColor=[0,0,1]; Opt.time = time; Opt.yDir = 'reverse'; barChartRace(y, Opt)
It was great to see the communication and collaboration that happened over social media. By the way, Michio went ahead and extended his version of the bar chart race to include a few other options. You can find it here.
To leave a comment, please click here to sign in to your MathWorks Account or create a new one.