I have a heat map plot in MATLAB. However, the default text label on every box has the same font colour. This reduces readability.
How can I come up (MATLAB code/concept) with an adaptive font colouring scheme that reads the colour value of each box in the heat map, and automatically chooses a font colour that contrasts with the background?
I am happy to move to gnuplot/ggplot2/pgfplots/matplotlib if so required to achieve this