import matplotlib.pyplot as plt

假设有一组数据 x 和 y

x = [1, 2, 3, 4, 5] y = [1, 2, 3, 4, 5]

画出热力图

heatmap = plt.imshow(data)

设置坐标轴标签格式为字符串

heatmap.axes.set_xticklabels(['a', 'b', 'c', 'd', 'e']) heatmap.axes.set_yticklabels(['1', '2', '3', '4', '5'])

plt.show()

写一段python代码设置热力图中坐标轴标签格式为字符串

原文地址: https://www.cveoy.top/t/topic/bcz3 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录