`show_image` displays color image for MNIST_SAMPLE dataset

The chapter 4 notebook, has this line:

matplotlib.rc('image', cmap='Greys')

it sets the default color map (see https://stackoverflow.com/questions/33185037/how-to-set-default-colormap-in-matplotlib). Unless you do that you would have to specify it as you suggest below.

Instead of binary, you might want to use gray, e.g:

show_image(img,cmap='gray')
4 Likes