I created a two grids like this
height = 125; cb = MatrixPlot[ Table[Mod[i + j, 2], {i, 1, 2}, {j, 1, 8}] , ColorFunction -> "BlueGreenYellow" , ImageSize -> {Automatic, 2*height} ] p1 = MatrixPlot[ Table[1, {i, 1, 1}, {j, 1, 2}] , Mesh -> True , ColorFunction -> ColorData["DarkRainbow"] , ImageSize -> {Automatic, height} ] If I combine the two with Inset, I get
Graphics[{First@cb, Inset[p1, {0, 0}]}] What should I do if I want to cover the top-left two squares of the yellow/green grid with the red grid?
(I know I could redraw the larger grid with the color of some squares changed. But I want to know how to do it with Inset.)
Update, after trying to play with the parameters of Inset, I have found some appropriate parameters that works. But this takes a lot trials.
Is there a way to keep images with their "absolute" size when using Inset?
Manipulate[ Graphics[{First@cb, Inset[p1, {x, y}, {Left, Bottom}, {Automatic, w}]}, ImageSize -> ImageDimensions[cb]], {{x, -0.1}, -0.5, 0.5}, {{y, 0.8}, 0.0, 1.0}, {{w, 1.4}, 0.5, 2}] 





Insetcan take up to five arguments. The three you don't use are ones the give control over the size and placement of the inset in the main graphics panel. Read the full documentation forInsetto find out how to the additional arguments. $\endgroup$