I need to plot vertical scatters in matplotlib but I couldn't find anything in matplotlib.org/examples or StackOverflow.
I tried something of my own but I am missing Jitter. Jitter changes X component slightly for the points having same (or very similar) Y components so they won't overlap. Is there anything which I can use or will I have to change x components manually?
import numpy as np
from matplotlib import pyplot as plt
x = np.array([1,2,3])
l = ['A','B','C']
a = np.array([2,2,3])
b = np.array([3,3,4])
c = np.array([7,7,5])
d = (np.array(a) + np.array(b) + np.array(c)) / 3
plt.subplot(111)
plt.margins(0.2)
plt.xticks(x,l)
plt.plot(x, a, 'ro', label='a')
plt.plot(x, b, 'ro', label='b')
plt.plot(x, c, 'ro', label='c')
plt.plot(x, d, 'k_', markersize=15, label='avg')
plt.tight_layout()
plt.savefig('vertical_scatter')
plt.close()
which gave me following
I found this on Seaborn.
which is what I want but only using matplotlib.



