def showLearning(self, representation):
        xSlice = 0.  # value of x assumed when plotting V and pi
        xDotSlice = 0.  # value of xDot assumed when plotting V and pi

        warnStr = "WARNING: showLearning() called with 4-state "\
            "cartpole; only showing slice at (x, xDot) = (%.2f, %.2f)" % (
                xSlice,
                xDotSlice)

        (thetas, theta_dots) = self._setup_learning(representation)

        pi = np.zeros((len(theta_dots), len(thetas)), 'uint8')
        V = np.zeros((len(theta_dots), len(thetas)))

        for row, thetaDot in enumerate(theta_dots):
            for col, theta in enumerate(thetas):
                s = np.array([theta, thetaDot, xSlice, xDotSlice])
                terminal = self.isTerminal(s)
                # Array of Q-function evaluated at all possible actions at
                # state s
                Qs = representation.Qs(s, terminal)
                # Array of all possible actions at state s
                As = self.possibleActions(s=s)
                # If multiple optimal actions, pick one randomly
                a = np.random.choice(As[Qs.max() == Qs])
                # Assign pi to be an optimal action (which maximizes
                # Q-function)
                pi[row, col] = a
                # Assign V to be the value of the Q-function under optimal
                # action
                V[row, col] = max(Qs)

        self._plot_policy(pi)
        plt.title("Policy (Slice at x=0, xDot=0)")
        self._plot_valfun(V)
        plt.title("Value Function (Slice at x=0, xDot=0)")

        pl.draw()
``xSlice`` and ``xDotSlice`` - the value of ``x`` and ``xDot``
dataset/ETHPy150Open rlpy/rlpy/rlpy/Domains/FiniteTrackCartPole.py/FiniteTrackCartPole.showLearning