diff --git a/.gitignore b/.gitignore index ca59757..3b983e5 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,5 @@ graph/ run2.sh run3.sh run.sh venv/ .env +survey-export.csv +survey-results.png diff --git a/plot.py b/plot.py index 52e090c..0812e0a 100644 --- a/plot.py +++ b/plot.py @@ -9,15 +9,31 @@ conn = psycopg2.connect("postgres://postgres:password@localhost:5420/postgres") cur = conn.cursor() # Execute a query -cur.execute("SELECT difficulty FROM logs ORDER BY difficulty")# LIMIT 100000") +cur.execute("SELECT difficulty FROM logs_avg ORDER BY difficulty") # LIMIT 100000") # Retrieve query results difficulty = cur.fetchall() -cur.execute("SELECT time FROM logs ORDER BY difficulty")# LIMIT 100000") +cur.execute("SELECT mean_time FROM logs_avg ORDER BY difficulty") # LIMIT 100000") time = cur.fetchall() + +def norm(arr) -> [int]: + elements = [] + d = 10**7 + for (a,) in arr: + p = a / d + elements.append(p) + + return elements + + +time = norm(time) +difficulty = norm(difficulty) + # reproducible sample data as a pandas dataframe -#plt.figure(figsize=(4096, 4096)) +# plt.figure(figsize=(4096, 4096)) plt.scatter(difficulty, time) -#cursor(hover=True) +# cursor(hover=True) +plt.xlabel("Difficulty Factor (1e7)") +plt.ylabel("Time (1e7 μs)") plt.show()