Unable to plot Double Bar, Bar plot using pyplot for ndarray
np.arange(2) gives array([0, 1]), so only two values. If you try to plot three values (in y1 or y2) against this, that won’t work and it will throw the ValueError (telling you exactly this): Try using np.arange(3).