# How to overlap ListPlot and ArrayPlot? [closed]

Is it possible to make the points appear on the ArrayPlot? It doesn't have to be ListPlot to plot the points.

Following is the code:

getBaSin[x_, y_] := RandomInteger[{1, 3}]

plot1 = ArrayPlot[
ParallelTable[
getBaSin[x, y], {y, 0.3, -0.3, -0.1}, {x, -0.3, 0.3, 0.1}],
ColorRules -> {1 -> Red, 2 -> Green, 3 -> Blue}]
plot2 = ListPlot[{{-0.082788, 0}, {0.041394,
0.071696}, {0.041394, -0.071696}}]
Show[{plot1, plot2}]


## closed as off-topic by Szabolcs, Carl Lange, MarcoB, bbgodfrey, garejMay 27 at 13:45

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Szabolcs, Carl Lange, MarcoB, bbgodfrey, garej
If this question can be reworded to fit the rules in the help center, please edit the question.

• Please create a minimal example that illustrates the issue. Can you replace this with only three lines of code? Most of the code here is completely irrelevant to the question. See here for guidance. mathematica.meta.stackexchange.com/questions/2126/… – Szabolcs May 22 at 7:53
• Remove the AbsoluteTiming, then it works. You either need to rescale coordinates or use DataRange in ArrayPlot. – Szabolcs May 22 at 7:55
• Is there alternative way of AbsoluteTiming in this case? – 최준호 May 22 at 10:39
• Use a=b;//AsboluteTiming which is equivalent to AbsoluteTiming[a=b;]. Do not use a = b // AbsoluteTiming because it is equivalent to a = AbsoluteTiming[b]. – Szabolcs May 22 at 10:42

## 1 Answer

SeedRandom[1]
mat = Table[getBaSin[x, y], {y, 0.3, -0.3, -0.1}, {x, -0.3, 0.3, 0.1}];
points = {{-0.082788, 0}, {0.041394, 0.071696}, {0.041394, -0.071696}};
ArrayPlot[mat,
ColorRules -> {1 -> Red, 2 -> Green, 3 -> Blue},
DataRange -> {{-.3, .3}, {-.3, .3}},
Epilog -> {Black, PointSize[Large], Point @ points},
FrameTicks -> All]