What do you want to save?
Add Code snippet
New code examples
-
Python 2021-10-06 23:49:03
bar labeling in matplotlib
import matplotlib.pyplot as plt %matplotlib inline plt.style.use('ggplot') x = ['Nuclear', 'Hydro', 'Gas', 'Oil', 'Coal', 'Biofuel'] energy = [5, 6, 15, 22, 24, 8] x_pos = [i for i, _ in enumerate(x)] plt.bar(x_pos, energy, color='green') plt.xlabel(&q... Add solution