reset
set xlabel "Date"
set ylabel "Ratio"
set y2label "No. of Snapshots"
set datafile separator ","

# set title "For analyses from self-managed NSs"
# set title "For analyses from outsourced domains"
# set title "For analyses from popular NSs"

set terminal pngcairo size 1000,500

# set output 'figures/dnssec-status-vs-date-os.png'
# set output 'figures/dnssec-status-vs-date-sm.png'

set key left center textcolor variable

set xdata time
set timefmt "%Y-%m-%d"
set format x "%Y-%m-%d"
set yrange [0:1]

set ytics 0.1
set ytics nomirror

if (0){
plot "../data/dnssec-status-by-day-sm.csv" using 1:2 w lines lt rgb "blue" axis x1y2 title "No. of Snapshots", \
"../data/dnssec-status-by-day-sm.csv" using 1:3 w lines lt rgb "dark-spring-green" axis x1y1 title "Valid", \
"../data/dnssec-status-by-day-sm.csv" using 1:4 w lines lt rgb "brown" axis x1y1 title "Insecure", \
"../data/dnssec-status-by-day-sm.csv" using 1:5 w lines lt rgb "purple" axis x1y1 title "Bogus", \
"../data/dnssec-status-by-day-sm.csv" using 1:6 w lines lt rgb "grey" axis x1y1 title "Not Deployed"
}

if (0){
plot "../data/dnssec-status-by-day-os.csv" using 1:2 w lines lt rgb "blue" axis x1y2 title "No. of Snapshots", \
"../data/dnssec-status-by-day-os.csv" using 1:3 w lines lt rgb "dark-spring-green" axis x1y1 title "Valid", \
"../data/dnssec-status-by-day-os.csv" using 1:4 w lines lt rgb "brown" axis x1y1 title "Insecure", \
"../data/dnssec-status-by-day-os.csv" using 1:5 w lines lt rgb "purple" axis x1y1 title "Bogus", \
"../data/dnssec-status-by-day-os.csv" using 1:6 w lines lt rgb "grey" axis x1y1 title "Not Deployed"
}

if (1){
set xrange ["2014-07-01": "2021-03-20"]
set xtics ("2014-08-01", "2015-08-01", "2016-08-01", "2017-08-01", "2018-08-01", "2019-08-01", "2020-08-01")
set y2range [0:200000]
set y2tics 10000
set output 'figures/dnssec-status-vs-date-v1.png'

plot "../data/dnssec-status-by-day.csv" using 1:2 w lines lt rgb "blue" axis x1y2 title "No. of Snapshots", \
"../data/dnssec-status-by-day.csv" using 1:3 w lines lt rgb "dark-spring-green" axis x1y1 title "Valid", \
"../data/dnssec-status-by-day.csv" using 1:4 w lines lt rgb "brown" axis x1y1 title "Insecure", \
"../data/dnssec-status-by-day.csv" using 1:5 w lines lt rgb "purple" axis x1y1 title "Bogus", \
# "../data/dnssec-status-by-day.csv" using 1:6 w lines lt rgb "grey" axis x1y1 title "Not Deployed"
}

if (0){
set xrange ["2018-03-20": "2021-03-01"]
set xtics ("2018-04-01", "2019-04-01", "2020-04-01")
set y2range [0:2500]
set y2tics 250
set output 'figures/dnssec-status-vs-date-v2.png'

plot "../data/dnssec-status-by-day.csv" using 1:2 w lines lt rgb "blue" axis x1y2 title "No. of Snapshots", \
"../data/dnssec-status-by-day.csv" using 1:3 w lines lt rgb "dark-spring-green" axis x1y1 title "Valid", \
"../data/dnssec-status-by-day.csv" using 1:4 w lines lt rgb "brown" axis x1y1 title "Insecure", \
"../data/dnssec-status-by-day.csv" using 1:5 w lines lt rgb "purple" axis x1y1 title "Bogus", \
# "../data/dnssec-status-by-day.csv" using 1:6 w lines lt rgb "grey" axis x1y1 title "Not Deployed"
}



if (0){
plot "../data/dnssec-status-by-day-gandi.csv" using 1:2 w lines lt rgb "blue" axis x1y2 title "No. of Snapshots", \
"../data/dnssec-status-by-day-gandi.csv" using 1:3 w lines lt rgb "dark-spring-green" axis x1y1 title "Valid", \
"../data/dnssec-status-by-day-gandi.csv" using 1:4 w lines lt rgb "brown" axis x1y1 title "Insecure", \
"../data/dnssec-status-by-day-gandi.csv" using 1:5 w lines lt rgb "purple" axis x1y1 title "Bogus", \
# "../data/dnssec-status-by-day-gandi.csv" using 1:6 w lines lt rgb "grey" axis x1y1 title "Not Deployed"
}