I would like to replicate the following heatmap, and I'm quite close. I'm new to python and I don't get the axes and the coloring right.
def fun(C_1, C_2):
return np.multiply(C_1, C_2)
C_1 = np.linspace(-2,2,100)
C_2 = np.linspace(-2,2,100)
# filling the heatmap, value by value
fun_map = np.empty((C_1.size, C_2.size))
for i in range(C_1.size):
for j in range(C_2.size):
fun_map[i,j] = fun(C_1[i], C_2[j])
sns.heatmap(fun_map)
This produces the following plot. What I don't know is how to get the axis right, i.e. C_1 and C_2 instead of the indices.
And also, how do I only show the 0.5 steps, i.e. -2, -1.5, etc.?
Any help would be appreciated.


