#!/usr/bin/env python3
import matplotlib.pyplot as plt
# Capacity (TB) vs. Year available
SDLT_x = [ 1998, 2002, 2004, 2006 ]
SDLT_y = [ 0.11, 0.16, 0.3, 0.8]
SAIT_x = [ 2003, 2006 ]
SAIT_y = [ 0.5, 0.8]
T10K_x = [ 2006, 2008, 2011, 2013 ]
T10K_y = [ 0.5, 1, 5, 8.5 ]
I3592_x = [ 2003, 2005, 2008, 2011, 2014, 2017, 2018, 2023 ]
I3592_y = [ 0.3, 0.7, 1, 4, 10, 15, 20, 50]
LTO_x = [ 2000, 2003, 2005, 2007, 2010, 2012, 2016, 2018, 2021, 2025 ]
LTO_y = [ 0.1, 0.2, 0.4, 0.8, 1.5, 2.5, 6, 12, 18, 30]
# Axis labels
xax = [1998, 2000, 2002, 2004, 2006, 2008, 2010, 2012, 2014, 2016, 2018, 2021, 2023, 2025]
yax = [0.1, 0.2, 0.3, 0.5, 1, 1.5, 2.5, 5, 10, 20, 30, 50, 100]
axbounds = [1997, 2026, 0.09, 110]
# MatPlotLib Figure with Axes
fig = plt.figure(figsize=(8.0, 4.0), layout='constrained')
fig.set_dpi(100)
ax = fig.add_subplot(facecolor='0.9')
# Axes
# subs=[] means no minor ticks
ax.semilogy(subs=[])
ax.axis(axbounds)
# (data, labels)
ax.set_xticks( xax, xax )
ax.set_yticks( yax, yax )
ax.grid(True, linestyle='dotted')
# Data
SAIT_line = plt.plot( SAIT_x, SAIT_y, 'cs-', markersize = 8, label = "Sony SAIT" )
SDLT_line = plt.plot( SDLT_x, SDLT_y, 'y^-', markersize = 8, label = "Quantum SDLT" )
T10K_line = plt.plot( T10K_x, T10K_y, 'r*-', markersize = 8, label = "Oracle T10K" )
I3592_line = plt.plot( I3592_x, I3592_y, 'bp-', markersize = 10, label = "IBM 3592" )
LTO_line = plt.plot( LTO_x, LTO_y, 'ko-', markersize = 10, label = "LTO" )
# Labels
ax.legend(loc = [ 0.04, 0.58 ])
ax.set_ylabel("TB per cartridge", fontsize=12, labelpad=8)
ax.set_xlabel("Year available", fontsize=12, labelpad=8)
fig.suptitle('Tape storage capacities, ' + str(min(xax)) + ' - ' + str(max(xax)), fontsize=16)
# Output
plt.savefig("tape-capacities-" + str(min(xax)) + "-" + str(max(xax)) + ".svg")
plt.show()