% This program produces an example ten-hundred plot on daily confirmed COVID-19 cases.
% See Youtube https://youtu.be/NP3ZdQwrL_Q for an explanation.
% The data is from Johns Hopkins ending on March 30, 2020:
% https://github.com/CSSEGISandData/COVID-19/blob/master/csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_confirmed_global.csv
% By Jerry Zhu, jerryzhu@cs.wisc.edu, http://www.cs.wisc.edu/~jerryzhu.  April 1, 2020


load confirmed.txt
ROI=[63, 144, 140, 226, 138, 202, 210, 224, 117, 121, 132, 134];
ROIname={"China:Hubei", "South Korea", "Japan", "US", "Italy", "Spain", "Thailand", "UK", "France", "Germany", "India", "Iran"};

close all
figure; hold on

for i = 1:length(ROI)
    region = ROI(i);
    [x, y] = ten_hundred(confirmed(region, :));
    if ~(isnan(x) || isnan(y))
       text(x, y, ROIname(i))
    end

end

line([0 70], [0 70])
axis([0 70 0 70])
axis square
grid
xlabel('days between 1/10 and now')
ylabel('days between 1/100 and 1/10')
title('The Ten-Hundred Plot for COVID-19 confirmed cases on 3/30/2020')
print -dpdf ten_hundred.pdf
