-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot.py
More file actions
32 lines (26 loc) · 773 Bytes
/
plot.py
File metadata and controls
32 lines (26 loc) · 773 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env python3
import pandas as pd
import matplotlib.pyplot as plt
# Read the CSV file into a DataFrame
df = pd.read_csv("performance_data.csv")
# Iterate over unique function names and plot their performance data
for func_name in df["Function"].unique():
func_df = df[df["Function"] == func_name]
plt.errorbar(
func_df["Iterations per Run"],
func_df["Average Time (seconds)"],
yerr=func_df["Standard Deviation (seconds)"],
label=func_name,
marker="o",
)
# Set labels and title
plt.xlabel("Iterations per Run")
plt.ylabel("Average Time (seconds)")
plt.title("Performance of Functions")
plt.legend()
plt.grid(True)
# Set y-axis to logarithmic scale
plt.xscale("log")
plt.yscale("log")
# Show plot
plt.show()