1
$\begingroup$

If I have a function:

f[x_, y_, z_, d_] = 4 x + y + z + d;

and made lists for f for different values of the free parameters x,y,z,d, by

T := Table[f[x, y, z, d], {x, 2, 5, 1}, {y, 2, 6, 2}, {z, 5, 10, 1}, {d, 3, 7, 1}]

How to plot f[x, y, z, d] versus any coulomb of the table, i.e., x, y, z or d ..

** Edit **

So why ListPlot dosn't work if I one more than two varibles change, i.e., for

T = Table[{x, If[-50 < DC[x, y] < 50, sigma[x, y, z, d]]}, {x, -5, -2, 1}, {y, 2, 6, 1}, {z, 6, 9, 1}, {d, 2, 9, 1}];

ListPlot[T] stuck ..

$\endgroup$
2
  • 3
    $\begingroup$ Table[ { x, Table[ f[x, y, z, d] } ... ]? $\endgroup$
    – Kuba
    Jun 8, 2016 at 5:48
  • 1
    $\begingroup$ Just to explain @Kuba 's comment datax = Table[ { x, Table[ f[x, y0, z0, d0] }, {x,2,5,1} ] and you have to use specific value y0,z0,d0 for y,z,d. Then use ListPlot[datax]. Since you have an analytical expression you can also use Plot[f[x,y0,z0,d0],{x,2,5}]. $\endgroup$
    – Sumit
    Jun 8, 2016 at 9:57

2 Answers 2

1
$\begingroup$

You can plot your stuff like so:

Manipulate[ContourPlot3D[Norm[{4 x + y + z + d}], 
{x, -1, 1}, {y, -1, 1}, {z, -1, 1}, 
ContourStyle -> (Directive[Opacity[.3, #]] & /@ {Red, Green, Cyan}),
Contours -> {1, 2, 3}, MeshStyle -> None], {d, -1, 1}]

enter image description here

$\endgroup$
1
  • $\begingroup$ Please see my question, I edit .. $\endgroup$
    – S.S.
    Jun 8, 2016 at 14:20
0
$\begingroup$

Description

Below you will find two examples.

  • Example No.1 shows how to process function using a set of lists as
    input parameters (per column basis).

  • Example No.2 shows how to process function using all possible
    combinations of passed parameters; in your example it is {x,y,z,d}

Example 1:

(*data*)
x = {2, 5, 1};
y = {2, 6, 2};
z = {5, 10, 1};
d = {3, 7, 1};

(*operation*)
Thread[f[x, y, z, d]];

Example 2:

(*operation*)
Outer[f, x, y, z, d];
$\endgroup$
1
  • $\begingroup$ So, you want to plot a function of 4 independent variables in 3D space ? The only way seems to be by ListContourPlot3D $\endgroup$
    – Lotus
    Jun 8, 2016 at 9:57

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.