Hi GCats,
As per my understanding, you are trying to generate a custom plot for the "GridWorld" and are facing issues while doing so.
The plot of "GridWorld" has circles and rectangles patched, so it would be difficult to update them to get your desired customized "GridWorld" plot.
In order to achieve the desired "GridWorld," you can create a grid, followed by filling up the rectangles with the desired colors and symbols. Refer to the below code, where I have created a grid and put 'X' in a red-colored cell, which is my target cell, and you can extend this to achieve your desired result.
n = 9;
figure;
hold on;
targetXPos = 8;
targetYPos = 3;
rectangle('Position',[targetYPos,n-targetXPos+1,1,1],'FaceColor','r','EdgeColor','k');
for i = 1:n
for j = 1:n
rectangle('Position', [j, n-i+1, 1, 1], 'EdgeColor', 'k');
end
end
text(targetYPos+0.5,n-targetXPos+1.5,'X','HorizontalAlignment', 'center');
hold off;
axis([1 n+1 1 n+1]);
axis equal;
axis off;
Hopefully, this will help you!