2825 explained code solutions for 75 technologies


python-matplotlibHow to set y-axis label for bar chart


import matplotlib.pyplot as plt
plt.bar(['UA', 'UK', 'USA'], [10, 11, 12])
plt.ylabel('Coolness of the country')
plt.show()ctrl + c
import matplotlib.pyplot as plt

loads Matplotlib module to use plotting capabilities

.bar

will plot bar chart

['UA', 'UK', 'USA']

x-axis values

[10, 11, 12]

y-axis values

ylabel

set label for y-axis

.show()

render chart in a separate window