I'm trying to draw a grid of cells using Matplotlib where each border (top, right, bottom, left) of a cell can have a different width (random number between 1 and 5). I should note also that the width and height of the inner area of a cell (white part) can vary between 15 and 20.
I want to know how to get the coordinates of each cell in order to avoid any extra space between the cells.
I tried several ideas however I did not get the right coordinates.

