在热图上绘制散点图

时间:2019-12-08 17:24:10

标签: python seaborn scatter-plot

当试图在应该从-1到1的热图上绘制散点图时,热图的标签不会居中于0。如何设置轴,以使列和索引与它们的数值匹配? / p>

space = np.arange(-1,1.025,0.25)
heatmap_data = pd.DataFrame([[myfunc(x,y) for x in space]for y in space], columns=space, index=space)
sns.heatmap(heatmap_data)
plt.scatter(0,0) #the point 0,0 appears in the corner, and I'm looking for it to be in the center

应用于二次函数时的绘图图像: plot applied to a quadratic function

0 个答案:

没有答案