Member-only story

How to create a game board using matplotlib

Crystal X
2 min readMar 29, 2022

--

In my last post I discussed how to create a game board using tkinter, which is compatible with the Python library, and can be read here:- https://tracyrenee61.medium.com/how-to-create-a-tkinter-game-board-using-replit-fabcc3acbfe7

Although I was pleased with the outcome of the video, I wanted a piece of code that was made from matplotlib, which is a standard library that is used in Python.

I searched the internet and I found code to produce a game board using matplotlib, which I intend to discuss in the psuedocode below:-

  1. Import the matplotlib library.
  2. Create the gameboard.
  3. Draw the grid.
  4. Scale the axis area to fill the figure.
  5. Remove the axis.
  6. Scale the plot area.
  7. Show the board that has just been created.

A screen shot of the game board that has been created, using the above code, can be viewed below:-

--

--

Crystal X
Crystal X

Written by Crystal X

I have over five decades experience in the world of work, being in fast food, the military, business, non-profits, and the healthcare sector.

No responses yet