I am trying to figure out how to align different types of plots into one image. For example in the following code, it plots two lines on top of a MatrixPlot. I want the lines to pass through the corners of the red squares in the overlaid image.
Overlay[{
MatrixPlot[Table[Mod[i^2 + j^2, 3], {i, 20}, {j, 20}],
ColorRules -> {0 -> Red, 1 -> White, 2 -> White}, AspectRatio -> Full],
Plot[{y = x, y = -x/1 + 1}, {x, 0, 1}, AspectRatio -> Full]},
ImageSize -> Full]
How can I create the image so the lines and squares fit together better?
