Plot points in grid

Hi I have a grid of 100 elements that contain only three values 1 or 2 or 3 for each element.
MyGrid = fill(1, (10, 10));
MyGrid [rand(1:100)] = 2;

I want to plot this grid as points. Each point will take different color based on its value
for example point that has 1 colored with red
point that has 2 colored with green
point that has 3 colored with black

Take a look at MeshViz.jl, I understand you want to plot the centers of cells in a grid with colors?

using Meshes
using MeshViz

# choose Makie backend
import GLMakie as Mke

grid = CartesianGrid(10, 10)
vals = rand(1:3, 10, 10)

# visualize grid
viz(grid, color=vec(vals))

# visualize centroids
viz(centroid.(grid), color=vec(vals))


1 Like

fig1

something like that

Updated the answer based on your reply.