Plots jittered points as a distribution visualizer.

  Scatter plot arguments default to: marker='.', c='k', alpha=0.75
  Also known as a stripplot.
  See also: boxplot, violinplot, beeswarm

def jitterplot(data, positions=None, ax=None, vert=True, scale=0.1,
               **scatter_kwargs):
  '''Plots jittered points as a distribution visualizer.

  Scatter plot arguments default to: marker='.', c='k', alpha=0.75
  Also known as a stripplot.
  See also: boxplot, violinplot, beeswarm
  '''
  if ax is None:
    ax = plt.gca()
  if positions is None:
    positions = range(len(data))

  kwargs = dict(marker='.', c='k', alpha=0.75)
  kwargs.update(scatter_kwargs)

  for pos, y in zip(positions, data):
    if scale > 0:
      x = np.random.normal(loc=pos, scale=scale, size=len(y))
    else:
      x = np.zeros_like(y) + pos
    if not vert:
      x, y = y, x
    ax.scatter(x, y, **kwargs)
  return plt.show