# duty of contourplot for lists and import data containing $\pi$

We have two lists with plot: ( Because they are not very short we uploaded list1 and list2,here and here)

In some regions the values related to the z axis of list2 gets exceeding from the values related to the z axis of list1. We specified these regions with red color.

Main Question: Because we have data and not functions, we could not use ContourPlot to show these areas. How can we present these zones in a 2 dimensional plane.

Second Question: We exploited

Export["list1.txt", list1, "Table"];

and

read = Import["list1.txt", "Table"];

to save and read data. But in importing, we think Pi will not be imported in a suitable format. How can we import data which contain Pi as $\pi$?

• read = ToExpression[Import["list1.txt", "Table"]]; works Commented Dec 16, 2017 at 16:03

lst1 = Import["/Users/roberthanlon/Downloads/list1.txt", "Table"] //
ToExpression;

ToExpression;


The lists have the same length and the data lies on the same grid.

{Length[lst1] == Length[lst2], (Most /@ lst1) == (Most /@ lst2)}

(* {True, True} *)


The absolute differences of the z values are

lst3 = Append @@@
Transpose[{Most /@ lst1, Abs[(Last /@ lst1) - (Last /@ lst2)]}];


Using ListContourPlot for the absolute differences

ListContourPlot[lst3,
PlotLegends -> Automatic,
ColorFunction -> "TemperatureMap"]


EDIT: Looking only at lst2 > lst1

lst4 = Append @@@
Transpose[{Most /@ lst1,
Max[#, 0] & /@ ((Last /@ lst2) - (Last /@ lst1))}];

ListContourPlot[lst4, PlotLegends -> Automatic,
ColorFunction -> (Blend[{White, Red}, #] &)]


• Thank you so much, If we ignore Abs, I think the considered zones are more clear. It would be very desired if all differences (of two lists) get zero except when list2>list1, in this case, the color of all ListContourPlot zones will be the same except while list2>list1 Commented Dec 16, 2017 at 18:32
• list3 = Table[{i, j, 0}, {i, 0, 4 \[Pi], \[Pi]/16}, {j, collection}]; list3new = Flatten[list3, 1];Do[ If[list1[[i]][[3]] - list2[[i]][[3]] < 0, list3new[[i]][[3]] = list2[[i]][[3]] - list1[[i]][[3]]] , {i, 1, Length@list2}] Commented Dec 16, 2017 at 18:58
• the above code approximately does the goal but in an unprofessional way. Your guidance is more professional than mine. Thanks a bunch!! Commented Dec 16, 2017 at 19:05