heatmap2.py 418 B

12345678910111213141516
  1. import pandas as pd
  2. import matplotlib.pyplot as plt
  3. import seaborn as sns
  4. df = pd.DataFrame({"Day 1": [4,1,3],
  5. "Day 2" : [1,2,4],
  6. "Day 3" : [2,1,3]})
  7. # sns.heatmap(df.corr())
  8. sns.heatmap(df.corr(), vmin = -1, vmax = +1, annot = True, cmap = 'coolwarm')
  9. # sns.lineplot(data = df)
  10. path = '../img/'
  11. filename = 'filename.png'
  12. saved = path + filename
  13. plt.savefig(saved, dpi = 300)