I have a single band raster tif image with 5 values i.e 4,3, 2, 1, 0 .
This code displays image with random color assigned to each pixel value
import rasterio
from rasterio.plot import show
import matplotlib.pyplot as plt
img_data = rasterio.open(img)
fig, ax = plt.subplots(figsize=(10,10))
show(img_data)
How can I display this image by assigning particular color to each image (E.g. red: 4,blue:3, green:2, black:1, white: 0). I came across colormap option but I am not able to display it as desired.