# How to get a 2D Plot from a 3D Listplot?

I have the following ListPlot3D , where C is specific Heat , T temperature and n concentration, my list first column present n, second T and third column is for C. I have this code to plot 3D graph from file name "data"

data = PadLeft[Import["E:\\new_n\\T(n).dat", "Table"]];
d = ListPlot3D[data, PlotRange -> Full, AxesLabel -> {n, T, C},
PlotStyle -> Green]


Any suggestions are very appreciated.

• How do you want to get the 2D plot? Along which axis? What view point? Can you just project onto the XY plane? Onto the XZ plane? We'll need more info to help you – b3m2a1 Feb 24 at 11:41
• @b3m2a1 i want to plot T(c) plane xy – Тахер Бен Feb 24 at 11:56
• Sorry I cannot access data from the link, but Show[d,ViewPoint->{0,0,Infinity}] should work! – Ulrich Neumann Feb 24 at 15:44

data = PadLeft[Import["E:\\new_n\\T(n).dat", "Table"]];
T = data[[All, 2]]; c = data[[All, 3]];
ListPlot[Table[{c[[i]], T[[i]]}, {i, 1, Length[c]}],
AxesLabel -> {"c", "T"}, PlotRange -> All]


Find the maximum values c[n,T] for all n:

k = 0; j = 0; nn = {1}; Do[
Do[If[n[[i + j]] == n[[i + j + 1]], k = k + 1, Break[]], {i, j + 1,
Length[n]}]; k1 = If[k > Length[n], Length[n], k];
nn = Flatten[{nn, k1}]; If[k >= Length[n] - 1, Break[]];, {100}]
m = {}; Do[
m = Flatten[{m,
MaximalBy[Table[data[[i]], {i, nn[[j]], nn[[j + 1]]}], Last]},
1];, {j, 1, Length[nn] - 1}]


Using m we find T[n]

ListPlot[Table[{m[[i, 1]], m[[i, 2]]}, {i, 1, Length[m]}],
PlotRange -> All, AxesLabel -> {"n", "T"}]


• Sir @Alex Trounev is there anyway to build it T(n) by selecting maximum value of c every n concentration automatically , if there any suggest are very appreciated , like in this file in like [Link]( drive.google.com/open?id=1sOiO9zR-OL5X5OJ1XdUErfo-Gu5g52vL) – Тахер Бен Feb 24 at 16:27
• In your file data T[n] with two maximum, I showed how to find one. – Alex Trounev Feb 25 at 0:10

You may use ListContourPlot. Also, you may want to have a look at the ColorFunction option of these functions.

With data as in OP. Then

ListContourPlot[data,
PlotRange -> Full,
FrameLabel -> {n, T},
PlotLegends -> Automatic,
ColorFunction -> ColorData[{"StarryNightColors", "Reverse"}]
]


Hope this helps.