matplotlib绘制热图

来源:互联网 发布:java运行环境官方下载 编辑:程序博客网 时间:2024/04/27 16:23
# -*- coding: utf-8 -*-

import numpy as np
import matplotlib.pyplot as plt

def plot_heat_map(x,figure_no):
    plt.figure(figure_no)
    plt.pcolor(x)
    plt.colorbar()

if __name__=='__main__':
    plt.close('all')
    x=np.random.normal(loc=0.5,scale=0.2,size=(10,10))

    plot_heat_map(x,2)


原创粉丝点击