Analyzing medal counts in all olympia data
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Markus Eckhardt
am 23 Jan. 2022
Beantwortet: Image Analyst
am 24 Jan. 2022
So I have a table with 150+ countries and their respective medal counts. To analyze the data considering the power law distribution I want to plot it into a histogram and rank plot. But I think with that many countries it would be to chaotic. How would you suggest for me to plot the medal count distribution in a more convenient way?
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 24 Jan. 2022
fileName = 'medals_total.csv'
t = readtable(fileName);
% Get rid of last row
t = t(1:end-1, :)
counts = t.CombinedTotal;
sortedt = sortrows(t, 2, 'descend')
% Plot by country
subplot(2, 1, 1);
bar(sortedt.CombinedTotal)
grid on;
xlabel('Country')
ylabel('Medal count')
% Take histogram of how many countries won different amounts of medals
subplot(2, 1, 2);
histogram(counts, 30)
grid on;
xlabel('Medal count')
ylabel('# Countries with that Medal count')
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Line Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!