Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()