# ListContourPlot: ColorFunction or something more?

My code is:

data1 = Table[Sin[x*y], {x, -3, 3, 0.1}, {y, -3, 3, 0.1}];
data2 = Reverse[data1, {1, 2}];
ListContourPlot[data1 - data2, Contours -> 20,
PlotLegends -> Automatic]


and, as Output, I obtain:

My question: it is easy to see that the Output is approximately zero. How can I fix my Output to see with PlotLegends that it is zero?

My attempt was to reduce number of contours:

But result not so pretty good. I assume that I can fix ColorFunction for Contours (may be reduce its step...?) but don't understand how. Can anybody help me?

• ListContourPlot[data1 - data2 // Chop, Contours -> 20, PlotLegends -> Automatic]? – march Apr 26 at 15:27
• @march Thank you! But what if the difference between two data sets not so small, but I would like to obtain zero? – Artem Alexandrov Apr 26 at 15:33
• Well, you've set Contours -> 20, so it's going to try to find 20 contours unless it knows that all the values are exactly the same (for instance, by Chopping as we did). You can somewhat artificially increase the PlotRange by adding PlotRange -> {-10, 10}. I'm not sure why you want to do this, though. If the data really are larger, why do you want to force them to be zero? In any case, you can also add a second option to Chop. By default, it sets to zero any number less than 10^-10, but you can change this by doing Chop[number, 10^-8], for instance. – march Apr 26 at 15:53