title: How to manually create a label in Matplotlib.pyplot
body: <p>I am trying to compare 2 figures as follows:</p>
  <p><a href="https://i.stack.imgur.com/6xOwN.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6xOwN.jpg" alt="Image 1" /></a></p>
  <p><a href="https://i.stack.imgur.com/Tfbfx.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Tfbfx.jpg" alt="Image 2" /></a></p>
  <p>I using the function subplot() under the library Matplotlib.pylot to plot these 2 images, and the following are my codes:</p>
  <pre><code>def Plot_Labels(data,data_check):
    data = np.reshape(data,(414,507))
    #data = np.reshape(data,(414,507))
    shape = data.shape
    nan_mask = np.isnan(data_check)
    data_mask = data[~nan_mask]
    valid_data = np.empty(shape)
    valid_data[~nan_mask] = data_mask
    valid_data[nan_mask] = np.nan
  
    fig, axes = plt.subplots()
    im = axes.imshow(valid_data)
    bar = plt.colorbar(im)
    bar.set_label('Flood Hazard')
    plt.show()
  </code></pre>
  <p>However, the labels in these 2 figures are different. For example, both 4 and 5 gives the same yellow color in the 2 figures respectively. Therefore, is there any method to manually create label 5 in the second figure, so that the 2 figures become comparable?</p>