Untitled
unknown
plain_text
15 days ago
976 B
3
Indexable
import matplotlib.pyplot as plt import matplotlib.patches as mpatches # Step data steps = ["Design", "Screen Setup (Constraint)", "Printing", "Drying", "Packaging"] capacities = [50, 20, 40, 35, 50] # Items per hour # Colors: highlight constraint in red colors = ["skyblue", "red", "skyblue", "skyblue", "skyblue"] # Create bar chart plt.figure(figsize=(10, 6)) bars = plt.bar(steps, capacities, color=colors) # Add labels above bars for bar in bars: yval = bar.get_height() plt.text(bar.get_x() + bar.get_width() / 2.0, yval + 1, f'{yval} items/hr', ha='center', va='bottom') # Title and labels plt.title("T-Shirt Printing Process: Step Capacities per Hour") plt.ylabel("Capacity (Items per Hour)") # Add legend constraint_patch = mpatches.Patch(color='red', label='Constraint (Bottleneck)') normal_patch = mpatches.Patch(color='skyblue', label='Non-Constraints') plt.legend(handles=[constraint_patch, normal_patch]) # Show plot plt.tight_layout() plt.show()
Editor is loading...
Leave a Comment