I am running these on OSX 10.12.5, Python 3.5.2 or Python 3.6.1, and matplotlib 2.0.0 or 2.0.2

import numpy as np

import matplotlib.pyplot as plt

import matplotlib.animation as animation

fig, ax = plt.subplots()

ims = []

xh = np.random.randn(10)

for i in range(100):

xh = np.append(xh, np.random.randn(10))

a, b = np.histogram(xh, bins=24, normed=True)

xx = 0.5*(b[:-1]+b[1:])

ax.set_xlim(-3, 3)

ax.set_ylim(0, 0.5)

im = ax.bar(xx, a, width=0.9*(b[1]-b[0]), color='C1')

ims.append(im)

# im, = ax.plot(xx, a, '-oC0')

# ims.append([im])

ani = animation.ArtistAnimation(fig, artists=ims, interval=50,

repeat=False)

plt.show()

import numpy as np

import matplotlib.pyplot as plt

import matplotlib.animation as animation

def f(x, y):

return np.sin(x) + np.cos(y)

xm = np.linspace(0, 2 * np.pi, 120)

ym = np.linspace(0, 2 * np.pi, 120).reshape(-1, 1)

fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(8, 3.5))

ax1.axis('off')

ims = []

xh = np.random.randn(10)

for i in range(100):

xm += np.pi / 20.

ym += np.pi / 20.

im1 = ax1.imshow(f(xm, ym), cmap=plt.get_cmap('plasma'),

aspect='equal', animated=True)

xh = np.append(xh, np.random.randn(10))

a, b = np.histogram(xh, bins=24, normed=True)

xx = 0.5*(b[:-1]+b[1:])

ax2.set_xlim(-3, 3)

ax2.set_ylim(0, 0.5)

# im2 = ax2.bar(xx, a, width=0.9*(b[1]-b[0]), color='C1')

im2, = ax2.plot(xx, a, '-oC0')

ims.append([im1, im2])

ani = animation.ArtistAnimation(fig, artists=ims, interval=50,

repeat=False)

# ani.save('junk.mp4')

plt.show()