-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplotGenerator.py
More file actions
32 lines (26 loc) · 807 Bytes
/
Copy pathplotGenerator.py
File metadata and controls
32 lines (26 loc) · 807 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
import matplotlib.pyplot as plt
import numpy as np
# Data
categories = ['Category 1', 'Category 2', 'Category 3', 'Category 4']
series1 = [4, 7, 1, 8]
series2 = [5, 6, 3, 5]
series3 = [6, 5, 4, 6]
# Number of categories and series
x = np.arange(len(categories)) # The label locations
width = 0.25 # The width of the bars
# Create the plot
fig, ax = plt.subplots(figsize=(10, 6))
# Plot each series
bars1 = ax.bar(x - width, series1, width, label='Series 1')
bars2 = ax.bar(x, series2, width, label='Series 2')
bars3 = ax.bar(x + width, series3, width, label='Series 3')
# Add labels, title, and legend
ax.set_xlabel('Matrix dimensions(x*x)')
ax.set_ylabel('Time (s)')
ax.set_title('Title')
ax.set_xticks(x)
ax.set_xticklabels(categories)
ax.legend()
# Display the plot
plt.tight_layout()
plt.show()