# Contour plot a 2d array

I have the calculated data for an interaction potential. My variables are distances (48 values) and angles(15 values) and my energy data is a 2d matrix of 48 x 15 values. How do i plot the energy as a contour? I am not sure how to assign it to a variable or import it as an array(Also it is a huge amount of data). I tried using Table and plotted using ListContourPlot, but i get the error "it is not a valid array". Is there any way to do this?

This is the smaller version of my data:

In[120]:= En = Table[Import["D:\pes\en.txt"]]

Out[120]= "0.00170451   0.00121435  0.00064304
0.00109223  0.0007588   0.00037006
0.00066955  0.00044523  0.00018417
0.00038108  0.00023235  6.00379142E-05"

In[121]:= Dis = List[6.05, 6.2, 6.35, 6.5]

Out[121]= {6.05, 6.2, 6.35, 6.5}

In[122]:= An = List[8.8877, 20.4014, 31.9828]

Out[122]= {8.8877, 20.4014, 31.9828}

In[124]:= ListContourPlot[{Dis, An, En}, InterpolationOrder -> 0.1]

During evaluation of In[124]:= ListContourPlot::arrayerr: {{6.05,6.2,6.35,6.5},{8.8877,20.4014,31.9828},0.00170451  0.00121435  0.00064304
0.00109223  0.0007588   0.00037006
0.00066955  0.00044523  0.00018417
0.00038108  0.00023235  6.00379142E-05} must be a valid array.

Out[124]= ListContourPlot[{{6.05, 6.2, 6.35, 6.5}, {8.8877, 20.4014,
31.9828}, "0.00170451    0.00121435  0.00064304
0.00109223    0.0007588   0.00037006
0.00066955    0.00044523  0.00018417
0.00038108    0.00023235  6.00379142E-05"}, InterpolationOrder -> 0.1]

• We can't know what's wrong without seeing the data. If it involves a lot of data, try to reproduce the problem with a smaller amount of data that you can post here (or so that you can post code that generates the sample data). Commented Oct 23, 2020 at 7:44
• Yes, i have edited my question. Commented Oct 23, 2020 at 9:17
• The first line import the numbers are a string. Try En = Import["D:\pes\en.txt", "Table"] and you should get a matrix instead. Commented Oct 23, 2020 at 10:28

Here is your example3. But it is not clear to which value of "En" which distance and angle to assign. I simply made an assumption. If I am wrong, you may have to swap d2 and d3 in: Flatten[Outer[List, d2, d3], 1].

d1 = ImportString[
"0.00170451   0.00121435  0.00064304 0.00109223  0.0007588   \
0.00037006 0.00066955  0.00044523  0.00018417 0.00038108  0.00023235  \
6.00379142E-05", "Table"][[1]];
d2 = List[6.05, 6.2, 6.35, 6.5];
d3 = List[8.8877, 20.4014, 31.9828];
d4 = Flatten[Outer[List, d2, d3], 1];

ListContourPlot[Pes, ContourLabels -> All, PlotLegends -> Automatic,