I have the following python code:

```python
plt.imshow(x_train[0], cmap='gray', interpolation = 'nearest')
```

I'm looking for a colormap that interpolates from blue through white to red. How do i do that?
Some colormap presets that interpolate from blue through white to red in matplotlib are the ```bwr``` and ```coolwarm``` diverging colormaps.

```
import numpy as np
import matplotlib.pyplot as plt

gradient = np.linspace(0, 1, 256)
gradient = np.vstack((gradient, gradient))

plt.imshow(gradient, aspect='auto', cmap='bwr')
```
Below is an instruction that describes a task. Write a response that appropriately completes the request.

### Instruction:

I have the following python code:

```python
plt.imshow(x_train[0], cmap='gray', interpolation = 'nearest')
```

I'm looking for a colormap that interpolates from blue through white to red. How do i do that?

### Response:

Some colormap presets that interpolate from blue through white to red in matplotlib are the ```bwr``` and ```coolwarm``` diverging colormaps.

```
import numpy as np
import matplotlib.pyplot as plt

gradient = np.linspace(0, 1, 256)
gradient = np.vstack((gradient, gradient))

plt.imshow(gradient, aspect='auto', cmap='bwr')
```
