if __name__=="__main__":
import seaborn as sns
import numpy as np
from pylab import *
#Define Data
data=np.zeros([64,64],dtype="float")
#Begin to Draw
POS_VALUE=0.8
NEG_VALUE=-0.8
data[1:31,1]=POS_VALUE
for i in range(1,11):
data[i,i]=POS_VALUE
for i in range(11,21):
data[21-i,i]=POS_VALUE
data[1:31,21]=POS_VALUE
data[2,31:34]=POS_VALUE
for i in range(0,7):
data[i+2,31-i]=POS_VALUE
data[8:25,25]=POS_VALUE
for i in range(25,32):
data[i,i]=POS_VALUE
data[31,31:34]=POS_VALUE
for i in range(34,41):
data[65-i,i]=POS_VALUE
data[8:25,40]=POS_VALUE
for i in range(0,7):
data[i+2,i+34]=POS_VALUE
data[1:31,43]=POS_VALUE
for i in range(1,11):
data[i,43+i]=POS_VALUE
for i in range(11,21):
data[21-i,43+i]=POS_VALUE
data[1:31,63]=POS_VALUE
for i in range(37,44):
data[i,i-11]=NEG_VALUE
for i in range(37,44):
data[i,64-i]=NEG_VALUE
for i in range(44,57):
data[i,i-23]=NEG_VALUE
for i in range(44,57):
data[i,89-i]=NEG_VALUE
for i in range(37,44):
data[i,i+2]=NEG_VALUE
for i in range(37,45):
data[i,77-i]=NEG_VALUE
data[33:63,11]=NEG_VALUE
data[33,9:14]=NEG_VALUE
data[63,9:14]=NEG_VALUE
data[33:57,47]=NEG_VALUE
for i in range(57,64):
data[i,i-10]=NEG_VALUE
data[63,53:56]=NEG_VALUE
for i in range(0,6):
data[63-i,i+55]=NEG_VALUE
data[33:58,61]=NEG_VALUE
#SHOW THE MAP
sns.heatmap(-data,xticklabels=False,yticklabels=False)
show()
祝天下的妈妈们,母亲节快乐!(尤其我妈)
热门评论
厉害了,太厉害了啊,
所有代码都放在if __main__ 里面,这个代码习惯可不好
看到的话请加一下我 谢谢老师