In [9]:
import gym
from matplotlib import pyplot as plt
import numpy as np
In [2]:
env = gym.make('CartPole-v0').env
In [17]:
samples = np.array([env.reset() for _ in xrange(100000)]).T
In [18]:
fig = plt.figure(figsize=(6,12))
for i in xrange(4):
ax = fig.add_subplot(4,1,i+1)
ax.hist(samples[i], normed=True)
plt.show()
In [19]:
del samples
In [ ]: