import matplotlib.pyplot as plt
days = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
steps_walked = [8934, 14902, 3409, 25672, 12300, 2023, 6890]
steps_last_week = [9788, 8710, 5308, 17630, 21309, 4002, 5223]
fig, axs = plt.subplots(1, 2, figsize=(12, 5))
# Plot line chart
axs[0].plot(days, steps_walked, "o-g")
axs[0].plot(days, steps_last_week, "v--m")
axs[0].set_title("Step count | This week (green) and last week (magenta)")
axs[0].set_xlabel("Days of the week")
axs[0].set_ylabel("Steps walked")
axs[0].grid(True)
# Plot bar chart
x_range_current = [-0.2, 0.8, 1.8, 2.8, 3.8, 4.8, 5.8]
x_range_previous = [0.2, 1.2, 2.2, 3.2, 4.2, 5.2, 6.2]
axs[1].bar(x_range_current, steps_walked)
axs[1].bar(x_range_previous, steps_last_week)
axs[1].set_title("Step count | This week (blue) and last week (orange)")
axs[1].set_xlabel("Days of the week")
axs[1].set_ylabel("Steps walked")
axs[1].grid(True)
plt.show()