Create a graph in Python
ibraries
import numpy as np
import matplotlib.pyplot as plt
Create a dataset
objects = ('Python', 'Java', 'Swift', 'JavaScript')
performance = [10, 8, 9, 8]
y_pos = np.arange(len(objects))
Create bars with different colors
plt.bar(y_pos, performance, align='center', alpha=0.7, color=['red', 'yellow', 'red', 'yellow'])
Create names on the x-axis
plt.xticks(y_pos, objects)