Skip to content

Commit

Permalink
Update ChessBoard.py (#354)
Browse files Browse the repository at this point in the history
  • Loading branch information
vignesh1507 authored Oct 23, 2024
1 parent d2b4ed4 commit a5b3c4d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Chess Board/ChessBoard.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
plt.show()

0 comments on commit a5b3c4d

Please sign in to comment.