利用python pyheatmap包绘制热力图,供大家参考,具体内容如下
import matplotlib.pyplot as plt
from pyheatmap.heatmap import HeatMap
def plot_data(filename):
with open(filename,'r') as fh:
data=fh.read().split('\n')
xs = []
ys = []
data_test=[]
for line in data:
li
本文实例为大家分享了python绘制热力图的具体代码,供大家参考,具体内容如下
python的热力图是用皮尔逊相关系数来查看两者之间的关联性。
#encoding:utf-8
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from matplotlib import cm
from matplotlib import axes
import pylab
pylab.mpl.rcParams