Open rjb23 opened 1 year ago
In this version, each task in the tasks list is associated with a color from the colors list. You can customize the colors or add more tasks as needed. The resulting bar chart will have each task color-coded differently for better visualization.
import matplotlib.pyplot as plt
tasks = ['Task A', 'Task B', 'Task C', 'Task D', 'Task E'] hours = [10, 8, 12, 5, 14]
colors = ['skyblue', 'lightgreen', 'lightcoral', 'lightsalmon', 'lightsteelblue']
plt.bar(tasks, hours, color=colors)
plt.xlabel('Tasks') plt.ylabel('Hours') plt.title('Work Week Tasks and Hours')
plt.show()
In this version, each task in the tasks list is associated with a color from the colors list. You can customize the colors or add more tasks as needed. The resulting bar chart will have each task color-coded differently for better visualization.
import matplotlib.pyplot as plt
Your work week tasks and corresponding hours
tasks = ['Task A', 'Task B', 'Task C', 'Task D', 'Task E'] hours = [10, 8, 12, 5, 14]
Define colors for each task
colors = ['skyblue', 'lightgreen', 'lightcoral', 'lightsalmon', 'lightsteelblue']
Create a bar chart with color-coded tasks
plt.bar(tasks, hours, color=colors)
Adding labels and title
plt.xlabel('Tasks') plt.ylabel('Hours') plt.title('Work Week Tasks and Hours')
Show the plot
plt.show()