-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b3705a6
commit 7b55afc
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import matplotlib.pyplot as plt | ||
|
||
# Load the data from the files | ||
with open("stats.dat", "r") as f1: | ||
y1 = [float(line.strip()) for line in f1 if line.strip()] | ||
|
||
with open("stats.main.dat", "r") as f2: | ||
y2 = [float(line.strip()) for line in f2 if line.strip()] | ||
|
||
#with open("stats.dat", "r") as f2: | ||
# y3 = [float(line.strip()) for line in f2 if line.strip()] | ||
|
||
# Create x-values (row numbers) | ||
x1 = range(len(y1)) | ||
x2 = range(len(y2)) | ||
#x3 = range(len(y3)) | ||
|
||
# Plot the data | ||
plt.figure(figsize=(8, 6)) | ||
plt.plot(x1, y1, marker="o", linestyle="-", color="b", label="stats.dat") | ||
plt.plot(x2, y2, marker="x", linestyle="--", color="r", label="stats.main.dat") | ||
#plt.plot(x3, y3, marker=".", linestyle="-", color="g", label="stats.main.dat") | ||
|
||
# Customize the plot | ||
plt.xlabel("Row Index") | ||
plt.ylabel("Values") | ||
plt.title("Values from stats.dat and stats.main.dat") | ||
plt.legend() | ||
plt.grid() | ||
plt.show() | ||
|