this is my code:
hours = [hour1, hour2, hour3, hour4, hour5]
water_intake = [litres_of_water_consumed1, litres_of_water_consumed2, litres_of_water_consumed3, litres_of_water_consumed4, litres_of_water_consumed5]
plt.plot(hours, water_intake)
plt.title('Your water intake')
plt.xlabel('hours')
plt.ylabel('litres of water consumed')
But instead of using plot.show() and then saving the plot image through matplotlib window I want to do it through the script is there anyway to do that?