From a5b3c4d90cdf18e5ec023a67ac4f802ab84d1415 Mon Sep 17 00:00:00 2001 From: Vignesh Skanda Date: Wed, 23 Oct 2024 21:50:17 +0530 Subject: [PATCH] Update ChessBoard.py (#354) --- Chess Board/ChessBoard.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Chess Board/ChessBoard.py b/Chess Board/ChessBoard.py index 3a7971d..122080a 100644 --- a/Chess Board/ChessBoard.py +++ b/Chess Board/ChessBoard.py @@ -3,18 +3,18 @@ from matplotlib.colors import LogNorm dx, dy = 0.015, 0.05 -#numpy.arange returns evenly spaced values within a given interval -x = np.arange(-04.0, 4.0, dx) -y = np.arange(-04.0, 4.0, dy) -#returns coordinate matrices from coordinate vectors +# numpy.arange returns evenly spaced values within a given interval +x = np.arange(-4.0, 4.0, dx) # Corrected -04.0 to -4.0 +y = np.arange(-4.0, 4.0, dy) # Corrected -04.0 to -4.0 +# returns coordinate matrices from coordinate vectors X, Y = np.meshgrid(x, y) extent = np.min(x), np.max(x), np.min(y), np.max(y) Z1 = np.add.outer(range(8), range(8)) % 2 -plt.imshow(Z1, cmap="binary_r", interpolation="nearest", extent = extent, alpha=1) +plt.imshow(Z1, cmap="binary_r", interpolation="nearest", extent=extent, alpha=1) plt.title("Chess Board", fontweight="bold") -plt.show() \ No newline at end of file +plt.show()