The plane is divided into a grid and points is distributed on it.
num = 100;
r = N[1/20];
points = RandomReal[{0, 1}, {num, 2}];
fig = ListPlot[points, GridLines -> {Range[0, 1, r], Range[0, 1, r]},
PlotMarkers -> {Automatic, 3.5}, PlotStyle -> Red,
ImageSize -> 1000]
I am interested in colorizing specific regions in the plane.
fig2 = Graphics[{Green, Rectangle[]},
PlotRange -> {{0.7`, 0.4`}, {0.75`, 0.45`}}]
Show[fig2, fig]
But someting go wrong, any sugestion on how to do it correct? Aditionlly how to extend it to few squares in plane?
Show
override options given in the later ones. In this case, the settings for axes and gridlines are taken fromfig2
, i.e. are not included at all. The plot range offig2
becomes the plot range for the combined figure. $\endgroup$