Generation

generate functionTue, 21 Mar 2023

Add to this the code for generating a grid on the chart, as well as specifying the percentage difference directly on the chart bars plt.figure(figsize = (12, 4)) plt.bar(data.index, data['nutri'], color = 'darkblue', label = 'nutri') plt.bar(data.index, data['mineral'], color = 'brown', label = 'mineral')

plt.xticks(rotation = 0) plt.xlabel('nutrient') plt.ylabel('%') plt.title('nutrient vs mineral') plt.grid(axis = 'y') plt.legend(loc = 'best')

Questions about programming?Chat with your personal AI assistant