largestGraph.py
767 Bytes
import matplotlib.pyplot as plt
import numpy as np
f=open("YearlyLargestCC","r")
xpoints = np.array([2020,2021,2022,2023,2024,2025,2026,2027,2028,2029,
2030,2031,2032,2033,2034,2035,2036,2037,2038,2039,
2040,2041,2042,2043,2044,2045,2046,2047,2048,2049,
2050,2051,2052,2053,2054,2055,2056,2057,2058,2059,
2060,2061,2062,2063,2064,2065,2066,2067,2068,2069])
ypoints = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
i = 0
lines=f.readlines()
for line in lines:
ypoints[i] = float(line[:-1])
i = i + 1
plt.xlabel("Year")
plt.ylabel("Largest CC")
plt.plot(xpoints, ypoints)
#plt.show()
plt.savefig("YearlyLargestCC.png",dpi=100)
print("Graph saved in YearlyLargestCC.png")
print("MUs in YearlyLargestCCMUs")