Added matplot lib function calls
This commit is contained in:
+59
-7
@@ -1,15 +1,16 @@
|
|||||||
import pandas as pd
|
import pandas as pd
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
import matplotlib.pyplot as plt
|
||||||
|
|
||||||
def print_data(df):
|
def print_data(df):
|
||||||
# print("=========================================")
|
print("=========================================")
|
||||||
print(df)
|
print(df)
|
||||||
# print("-----------------------------------------")
|
print("-----------------------------------------")
|
||||||
# print(df.dtypes)
|
print(df.dtypes)
|
||||||
# print("-----------------------------------------")
|
print("-----------------------------------------")
|
||||||
# print(df.shape)
|
print(df.shape)
|
||||||
# print("-----------------------------------------")
|
print("-----------------------------------------")
|
||||||
# print(df.info())
|
print(df.info())
|
||||||
|
|
||||||
def load_data(filename, columns):
|
def load_data(filename, columns):
|
||||||
df = pd.read_csv(filename, header = None, sep = "\s+", comment ='#')
|
df = pd.read_csv(filename, header = None, sep = "\s+", comment ='#')
|
||||||
@@ -24,3 +25,54 @@ df_frequency = load_data("48yrs/frequency.dat", ["year", "frequency"])
|
|||||||
df_specint = load_data("48yrs/specint.dat", ["year", "specint"])
|
df_specint = load_data("48yrs/specint.dat", ["year", "specint"])
|
||||||
df_transistors = load_data("48yrs/transistors.dat", ["year", "transistors"])
|
df_transistors = load_data("48yrs/transistors.dat", ["year", "transistors"])
|
||||||
df_watts = load_data("48yrs/watts.dat", ["year", "watts"])
|
df_watts = load_data("48yrs/watts.dat", ["year", "watts"])
|
||||||
|
|
||||||
|
violet = []
|
||||||
|
violet.append((196/255, 0/255, 84/255))
|
||||||
|
|
||||||
|
orange = []
|
||||||
|
orange.append((237/255, 109/255, 0/255))
|
||||||
|
|
||||||
|
yellow = []
|
||||||
|
yellow.append((252/255, 200/255, 0/255))
|
||||||
|
|
||||||
|
green = []
|
||||||
|
green.append((98/255, 178/255, 48/255))
|
||||||
|
|
||||||
|
blue = []
|
||||||
|
blue.append((48/255, 181/255, 197/255))
|
||||||
|
|
||||||
|
black = []
|
||||||
|
black.append((25/255, 24/255, 21/255))
|
||||||
|
|
||||||
|
|
||||||
|
x = df_transistors.year
|
||||||
|
y = df_transistors.transistors
|
||||||
|
plt.scatter(x, y, marker = "^", color = yellow)
|
||||||
|
|
||||||
|
x = df_specint.year
|
||||||
|
y = df_specint.specint
|
||||||
|
plt.scatter(x, y, marker = "s", color = blue)
|
||||||
|
|
||||||
|
x = df_frequency.year
|
||||||
|
y = df_frequency.frequency
|
||||||
|
plt.scatter(x, y, marker = "s", color = green)
|
||||||
|
|
||||||
|
x = df_watts.year
|
||||||
|
y = df_watts.watts
|
||||||
|
plt.scatter(x, y, marker = "v", color = violet)
|
||||||
|
|
||||||
|
x = df_cores.year
|
||||||
|
y = df_cores.cores
|
||||||
|
plt.scatter(x, y, marker = "o", color = black)
|
||||||
|
|
||||||
|
plt.yscale('log')
|
||||||
|
|
||||||
|
# plt.legend(loc="upper right", ["Cold", "Medium", "Hot"])
|
||||||
|
plt.legend(["Transistors (thousands)",
|
||||||
|
"Single-thread SPECint (thousands)",
|
||||||
|
"Frequency (MHz)",
|
||||||
|
"Typical power (Watts)",
|
||||||
|
"Number of logical cores"],
|
||||||
|
loc = "upper left")
|
||||||
|
|
||||||
|
plt.show()
|
||||||
Reference in New Issue
Block a user