-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathqueue_graph.py
More file actions
26 lines (16 loc) · 1.5 KB
/
queue_graph.py
File metadata and controls
26 lines (16 loc) · 1.5 KB
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
import matplotlib.pyplot as plt
def plot():
# Plotting points as a scatter plot
all_lengths = [338, 1673, 1920, 1124, 1171, 974, 1944, 1660, 143, 703, 814, 1718, 2262, 2081, 846, 2353, 949, 614, 1547, 654, 807, 2339, 2050, 1714, 1632, 1757, 478, 1428, 2289, 860, 1503, 865, 438, 695, 1812, 1316, 1293, 1888, 2339, 1334, 608, 1142, 2407, 2168, 1427, 1462, 1669, 1849, 976, 609, 72, 350, 230, 1026, 1105, 907, 1091, 560, 2422, 2485, 2460, 484, 341, 109, 2416, 1650, 1561, 1944, 1232, 2291, 2179, 213, 1732, 2423, 1733, 2342, 159, 1165, 2475, 1710, 1480, 485, 1107, 1350, 119, 10, 2098, 1973, 2144, 699, 1902, 1632, 143, 206, 1337, 2058, 2033, 1504, 1390, 1431]
queue_time = [75, 3021, 4517, 1267, 1365, 830, 4587, 3163, 11, 387, 532, 3439, 6741, 5321, 587, 7643, 775, 268, 2530, 314, 505, 7444, 5091, 3234, 2849, 3413, 157, 2230, 6943, 633, 2338, 627, 125, 355, 3790, 1698, 1517, 3626, 7434, 1792, 267, 1202, 7848, 6006, 2045, 2433, 2832, 3521, 757, 236, 2, 66, 26, 822, 990, 609, 956, 195, 7226, 7618, 7671, 144, 72, 6, 7285, 2632, 2331, 4004, 1265, 6079, 5490, 40, 3716, 8862, 4215, 8048, 14, 1330, 9201, 3380, 2390, 164, 1261, 2220, 8, 0, 5776, 5127, 6257, 413, 4644, 3331, 12, 26, 1833, 5514, 5427, 2475, 2167, 2011]
plt.scatter(queue_time, all_lengths, label="Queue Points", color="red", s=30)
# Naming the x axis
plt.xlabel('Time')
# Naming the y axis
plt.ylabel('Size of Datasets')
# Giving a title to my graph
plt.title('Sorting using a Queue')
# Show a legend on the plot
plt.legend()
plt.show()
plot()