Introduction: Python - Create Bar Chart Using Matplotlib
import matplotlib.pyplot as mattexample
print ("Imported matplotlib")
# x axis values
x = [2, 4, 6, 8, 10, 12, 14, 16]
# y axis
y = [7, 5, 8, 6, 7, 8, 10, 14]
print("The x-axis values are: ", x)
print("The y-axis values are: ", y)
# Invoke bar function to generate bar graph
print ("Now invoking the bar function.")
mattexample.bar(x,y)
# Invoke the show function to display the bar graph
print ("Now showing the bar graph that was generated.")
mattexample.show()






