I can create and n by n heatmap using the following code, for example let n be 10:
random_matrix = np.random.rand(10,10)
number = 10
incrmnt = 1.0
x = list(range(1,number +1))
plt.pcolormesh(x, x, random_matrix)
plt.colorbar()
plt.xlim(1, number)
plt.xlabel('Number 1')
plt.ylim(1, number)
plt.ylabel('Number 2')
plt.tick_params(
axis = 'both',
which = 'both',
bottom = 'off',
top = 'off',
labelbottom = 'off',
right = 'off',
left = 'off',
labelleft = 'off')
I would like to add a 2 row heatmap one near each of the x and y axis, from say row1 = np.random.rand(1,10)
and col1 = np.random.rand(1,10)
.
Here is an example image of what I would like to produce:
Thanks in advance.