Skip to content

Commit d7fa29b

Browse files
committed
Style graphs
1 parent 27e5a65 commit d7fa29b

File tree

2 files changed

+49
-5
lines changed

2 files changed

+49
-5
lines changed

scripts/InputFileGenerator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ def main(argv):
354354

355355
actorList = []
356356
for i in range(0, 50):
357-
for j in range(0, 98):
357+
for j in range(0, 99):
358358
actorList.append(
359359
{
360360
"pos": [29.8 - (i * 0.2), 0.2 + (j * 0.2)],
@@ -368,7 +368,7 @@ def main(argv):
368368
}
369369
)
370370
for i in range(0, 50):
371-
for j in range(0, 98):
371+
for j in range(0, 99):
372372
actorList.append(
373373
{
374374
"pos": [0.2 + (i * 0.2), 0.2 + (j * 0.2)],

scripts/PlotGraphs.py

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,20 @@ def workingAnimation():
4545
animationThread = Thread(target=workingAnimation)
4646
animationThread.start()
4747

48+
fig = plt.figure()
49+
fig.set_facecolor("black")
50+
ax = plt.axes()
51+
ax.set_facecolor("black")
52+
ax.spines["bottom"].set_color("white")
53+
ax.spines["top"].set_color("white")
54+
ax.spines["left"].set_color("white")
55+
ax.spines["right"].set_color("white")
56+
ax.tick_params(axis="x", colors="white")
57+
ax.tick_params(axis="y", colors="white")
58+
ax.xaxis.label.set_color("white")
59+
ax.yaxis.label.set_color("white")
60+
ax.title.set_color("white")
61+
4862
# Plot average forces
4963
if not os.path.exists("../output/csv/averageForces.csv"):
5064
print("Error: couldn't find averageForces.csv")
@@ -54,14 +68,28 @@ def workingAnimation():
5468
averageForces = list(reader)
5569
averageForces = list(zip(*averageForces))
5670

57-
plt.plot(averageForces[0], averageForces[1])
71+
plt.plot(averageForces[0], averageForces[1], color="#A90092")
5872
plt.xlabel("Timestep")
5973
plt.ylabel("Average Force (N)")
6074
plt.title("Average Force Applied to Actor")
6175
plt.savefig("../output/images/averageForcesGraph.png")
6276

6377
plt.clf()
6478

79+
fig = plt.figure()
80+
fig.set_facecolor("black")
81+
ax = plt.axes()
82+
ax.set_facecolor("black")
83+
ax.spines["bottom"].set_color("white")
84+
ax.spines["top"].set_color("white")
85+
ax.spines["left"].set_color("white")
86+
ax.spines["right"].set_color("white")
87+
ax.tick_params(axis="x", colors="white")
88+
ax.tick_params(axis="y", colors="white")
89+
ax.xaxis.label.set_color("white")
90+
ax.yaxis.label.set_color("white")
91+
ax.title.set_color("white")
92+
6593
# Plot kernel execution times
6694
if not os.path.exists("../output/csv/kernelDurations.csv"):
6795
print("Error: couldn't find kernelDurations.csv")
@@ -71,14 +99,28 @@ def workingAnimation():
7199
kernelDurations = list(reader)
72100
kernelDurations = list(zip(*kernelDurations))
73101

74-
plt.plot(kernelDurations[0], kernelDurations[1], linewidth=0.5)
102+
plt.plot(kernelDurations[0], kernelDurations[1], linewidth=0.5, color="#FBFF00")
75103
plt.xlabel("Kernel Number")
76104
plt.ylabel("Execution Time (μs)")
77105
plt.title("Kernel Execution Times")
78106
plt.savefig("../output/images/kernelDurationsGraph.png")
79107

80108
plt.clf()
81109

110+
fig = plt.figure()
111+
fig.set_facecolor("black")
112+
ax = plt.axes()
113+
ax.set_facecolor("black")
114+
ax.spines["bottom"].set_color("white")
115+
ax.spines["top"].set_color("white")
116+
ax.spines["left"].set_color("white")
117+
ax.spines["right"].set_color("white")
118+
ax.tick_params(axis="x", colors="white")
119+
ax.tick_params(axis="y", colors="white")
120+
ax.xaxis.label.set_color("white")
121+
ax.yaxis.label.set_color("white")
122+
ax.title.set_color("white")
123+
82124
# Plot actor arrival times
83125
if not os.path.exists("../output/csv/destinationTimes.csv"):
84126
print("Error: couldn't find distinationTimes.csv")
@@ -104,7 +146,9 @@ def workingAnimation():
104146
alteredDestinationTimes[1][x] += 1
105147

106148
if len(destinationTimes) > 0:
107-
plt.plot(alteredDestinationTimes[0], alteredDestinationTimes[1])
149+
plt.plot(
150+
alteredDestinationTimes[0], alteredDestinationTimes[1], color="#22AEE7"
151+
)
108152
plt.xlabel("No. of Actors at Destination")
109153
plt.ylabel("Time (ms)")
110154
plt.title("Actor Arrival Times at Destination")

0 commit comments

Comments
 (0)