Closed ScGPS closed 1 year ago
# Output chess board image (chess board image) import numpy as np import matplotlib.pyplot as plt chessboard = np.zeros([8*20,8*20]) for row in range(0,8): for column in range(0,8): if((column+8*row) % 2 ==1) and (row % 2 == 0): chessboard[row*20:row*20+20,column*20:column*20+20] = 1 elif((column+8*row) % 2 ==0) and (row % 2 == 1): chessboard[row*20:row*20+20,column*20:column*20+20] = 1 #set the plot's title. #plt.title('Chess Board') plt.xlim(xmin=0,xmax=160) plt.ylim(ymin=0,ymax=160) plt.imshow(chessboard,cmap='binary_r') # Print the chart plt.show()
Issue
Fixed issue