0
$\begingroup$

I have this data files:

 data1 = {{3.06122, 10000., 0.629892}, {3.06122, 11836.7, 0.590095}, {3.06122, 
13673.5, 0.55436}, {3.06122, 15510.2, 0.522086}, {3.06122, 17346.9, 
0.492813}, {3.06122, 19183.7, 0.466156}, {3.06122, 21020.4, 
0.441802}, {3.06122, 22857.1, 0.419489}, {3.06122, 24693.9, 
0.398983}, {3.06122, 26530.6, 0.380088}, {3.06122, 28367.3, 
0.362635}, {3.06122, 30204.1, 0.346477}, {3.06122, 32040.8, 
0.33148}, {3.06122, 33877.6, 0.317532}, {3.06122, 35714.3, 
0.304534}, {3.06122, 37551., 0.292397}, {3.06122, 39387.8, 
0.281043}, {3.06122, 41224.5, 0.270404}, {3.06122, 43061.2, 
0.260416}, {3.06122, 44898., 0.251027}, {3.06122, 46734.7, 
0.242185}, {3.06122, 48571.4, 0.233848}, {3.06122, 50408.2, 
0.225977}, {3.06122, 52244.9, 0.218535}, {3.06122, 54081.6, 
0.211491}, {3.06122, 55918.4, 0.20481}, {3.06122, 57755.1, 
0.198475}, {3.06122, 59591.8, 0.192454}, {3.06122, 61428.6, 
0.186732}, {3.06122, 63265.3, 0.181285}, {3.06122, 65102., 
0.176093}, {3.06122, 66938.8, 0.171143}, {3.06122, 68775.5, 
0.166419}, {3.06122, 70612.2, 0.161905}, {3.06122, 72449., 
0.157591}, {3.06122, 74285.7, 0.153461}, {3.06122, 76122.4, 
0.149508}, {3.06122, 77959.2, 0.14572}, {3.06122, 79795.9, 
0.142087}, {3.06122, 81632.7, 0.1386}, {3.06122, 83469.4, 
0.135253}, {3.06122, 85306.1, 0.132036}, {3.06122, 87142.9, 
0.128947}, {3.06122, 88979.6, 0.125967}, {3.06122, 90816.3, 
0.123105}, {3.06122, 92653.1, 0.120346}, {3.06122, 94489.8, 
0.117688}, {3.06122, 96326.5, 0.115127}, {3.06122, 98163.3, 
0.112655}, {3.06122, 100000., 0.110269}}

data2 = {{1.63265, 10000., 0.629892}, {1.63265, 11836.7, 0.590095}, {1.63265, 
  13673.5, 0.55436}, {1.63265, 15510.2, 0.522086}, {1.63265, 17346.9, 
  0.492813}, {1.63265, 19183.7, 0.466156}, {1.63265, 21020.4, 
  0.441802}, {1.63265, 22857.1, 0.419489}, {1.63265, 24693.9, 
  0.398983}, {1.63265, 26530.6, 0.380088}, {1.63265, 28367.3, 
  0.362635}, {1.63265, 30204.1, 0.346477}, {1.63265, 32040.8, 
  0.33148}, {1.63265, 33877.6, 0.317532}, {1.63265, 35714.3, 
  0.304534}, {1.63265, 37551., 0.292397}, {1.63265, 39387.8, 
  0.281043}, {1.63265, 41224.5, 0.270404}, {1.63265, 43061.2, 
  0.260416}, {1.63265, 44898., 0.251027}, {1.63265, 46734.7, 
  0.242185}, {1.63265, 48571.4, 0.233848}, {1.63265, 50408.2, 
  0.225977}, {1.63265, 52244.9, 0.218535}, {1.63265, 54081.6, 
  0.211491}, {1.63265, 55918.4, 0.20481}, {1.63265, 57755.1, 
  0.198475}, {1.63265, 59591.8, 0.192454}, {1.63265, 61428.6, 
  0.186732}, {1.63265, 63265.3, 0.181285}, {1.63265, 65102., 
  0.176093}, {1.63265, 66938.8, 0.171143}, {1.63265, 68775.5, 
  0.166419}, {1.63265, 70612.2, 0.161905}, {1.63265, 72449., 
  0.157591}, {1.63265, 74285.7, 0.153461}, {1.63265, 76122.4, 
  0.149508}, {1.63265, 77959.2, 0.14572}, {1.63265, 79795.9, 
  0.142087}, {1.63265, 81632.7, 0.1386}, {1.63265, 83469.4, 
  0.135253}, {1.63265, 85306.1, 0.132036}, {1.63265, 87142.9, 
  0.128947}, {1.63265, 88979.6, 0.125967}, {1.63265, 90816.3, 
  0.123105}, {1.63265, 92653.1, 0.120346}, {1.63265, 94489.8, 
  0.117688}, {1.63265, 96326.5, 0.115127}, {1.63265, 98163.3, 
  0.112655}, {1.63265, 100000., 0.110269}}

The first entry is the same for all points in data1, the same is true for data2 too. I want to plot it in 3D, so I use:

ListPlot3D[{data1,data2}]

This is the result:

enter image description here

There is nothing!. If I delete the first entry I will get:

ListPlot[Table[Delete[data1[[i, All]], 1], {i, 1, 50}]]

enter image description here

How can I plot data1 and data2 in a 3D form?

I have another problem with ArrayPlot. I cannot plot data1 and data2 by ArrayPlot if I use ColorFunction option.

Suppose I have:

data3 =Flatten[Table[i + j + k, {i, 1, 5}, {j, 1, 10}, {k, 1, 3}], 1]

The dimension is 50 by 3 like data1 or data2.

If I use ColorFunction option, I get:

ArrayPlot[Flatten[Table[i + j + k, {i, 1, 5}, {j, 1, 10}, {k, 1, 3}], 1],ColorFunction -> "SunsetColors"]

enter image description here

If I don't use ColorFunction option, I get:

enter image description here

I have this problem when I want to plot data1and data2. How can I resolve that?

$\endgroup$
  • 1
    $\begingroup$ ListPointPlot3D[{data1, data2}]? $\endgroup$ – Öskå Jul 2 '14 at 10:29
  • $\begingroup$ @Öskå. That worked. Thank you. Could you please tell me how I can plot it as a two dimensional plot with the third entry as the indicator of the density or intensity? If I use ArrayPlot or ListDensityPlot it won't work. I think the problem is that the first entry is same for each data file. $\endgroup$ – MOON Jul 2 '14 at 10:36
  • $\begingroup$ Ermmm, I don't get what you mean. Create a smaller example with the desired output :) $\endgroup$ – Öskå Jul 2 '14 at 10:39
1
$\begingroup$

ListPointPlot3D will achieve your aim:

ListPointPlot3D\[{data1, data2}, PlotLegends -> {"data1", "data2"}, 
 PlotStyle -> {Red, Blue}, ImageSize -> 500]

enter image description here

|improve this answer|||||
$\endgroup$
1
$\begingroup$

Maybe this?

x = Rest /@ data1;

MatrixPlot[x, ColorFunction -> Hue]

enter image description here

EDIT

To use the inbuilt color tables you could rescale your values to run from 0 to 1:

x2 = Transpose[Rescale /@ Transpose @ x];

MatrixPlot[x2, ColorFunction -> "SunsetColors", ColorFunctionScaling -> False]

enter image description here

|improve this answer|||||
$\endgroup$
  • $\begingroup$ Maybe I should have asked the other question you asked in a separate topic. Thank you for your answer. Could you please tell me how I could use SunsetColors instead? $\endgroup$ – MOON Jul 2 '14 at 13:41
  • $\begingroup$ @yashar See edit of my answer. $\endgroup$ – eldo Jul 2 '14 at 14:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.