heatmap1.py 364 B

123456789101112131415
  1. import numpy as np
  2. import matplotlib.pyplot as plt
  3. import seaborn as sns
  4. from PIL import Image
  5. # %config InlineBackend.figure_format = 'retina' # for using juyter hi-res render
  6. # 設定隨機種子
  7. np.random.seed(0)
  8. # 從均勻分配(0~1)之間抽出2*3陣列
  9. uniform_data = np.random.rand(2, 3)
  10. r = sns.heatmap(uniform_data)
  11. # sns.plt.show()
  12. r.savefig("y.jpg")