bar plot fix lenthgy labels matplot
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
plt.xticks(rotation='vertical')
bar plot fix lenthgy labels matplot
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
plt.xticks(rotation='vertical')
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("Energy Source")
plt.ylabel("Energy Output (GJ)")
plt.title("Energy output from various fuel sources")
plt.xticks(x_pos, x)
plt.show()
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us