I'm new to using Matplotlib. I'm trying to build a chart where values can also be negative. Using the generic graph from matplotlib
import matplotlib.pyplot as plt; plt.rcdefaults()
import numpy as np
import matplotlib.pyplot as plt
objects = ('Python', 'C++', 'Java', 'Perl', 'Scala', 'Lisp')
y_pos = np.arange(len(objects))
performance = [10,8,6,-4,2,1]
plt.bar(y_pos, performance, align='center', alpha=0.5)
plt.xticks(y_pos, objects)
plt.ylabel('Usage')
plt.title('Programming language usage')
plt.show()
This produces
However, I would like to use x-axis as y=0 line instead of having separate y=0. So for any negative values, it would appear below x-axis and for positive values, it will appear above x-axis.
It would somehow look like this.
I've managed to get rid of the surrounding lines and values on y-axis. Need to know how to make the x-axis the y=0 line.
Any help would be appreciated.
Thank you so much in advance.


