I consider large matrices attaining values in between -1 to 1 and I wish to plot their heatmaps in python. Most values are very small, let's say around 10^{-8}
but one or two entries are close to the edges. When I try the codes from the answers for this question I always get an image which is mostly unicolor with some points. For instance in this image the image is mostly red with some black points. I did try playing with vmin=np.amin(data),vmax=np.amax(data)
but of course it does not solve the issue. I also tried some divergent colormaps but they didn't help much.
I wonder if matplotlib
or seaborn
can handle such type of data and if it is possible changing the scale/colormap so it will be wider based on the frequency of values (in the photo, that would mean I want more hues of red while keeping black points).
Minimal example which yields mostly white plot:
import numpy as np
import seaborn as sns
import matplotlib.pylab as plt
uniform_data = np.random.rand(1200, 1200)
uniform_data /= 10 ** 8
uniform_data[42,42] += 2
uniform_data[442,442] -= 2
ax = sns.heatmap(uniform_data)
plt.show()