Heatmap with text in each cell with matplotlib’s pyplot

You need to add all the text by calling axes.text(), here is an example: import numpy as np import matplotlib.pyplot as plt title = “ROC’s AUC” xlabel= “Timeshift” ylabel=”Scales” data = np.random.rand(8,12) plt.figure(figsize=(12, 6)) plt.title(title) plt.xlabel(xlabel) plt.ylabel(ylabel) c = plt.pcolor(data, edgecolors=”k”, linewidths=4, cmap=’RdBu’, vmin=0.0, vmax=1.0) def show_values(pc, fmt=”%.2f”, **kw): from itertools import izip pc.update_scalarmappable() ax … Read more

Superimpose heatmap on a base image OpenCV Python

Updated Answer — 29th April, 2022. After the repeated comments I have decided to update this post with a better visualization. Consider the following image: img = cv2.imread(‘image_path’) I obtained a binary image after performing binary threshold on the a-channel of the LAB converted image: lab = cv2.cvtColor(img, cv2.COLOR_BGR2LAB) a_component = lab[:,:,1] th = cv2.threshold(a_component,140,255,cv2.THRESH_BINARY)[1] … Read more