0
$\begingroup$

How can I write a function with many variables to represent the following in Show and get figures?

enter image description here

$\endgroup$
1
  • 1
    $\begingroup$ Please post the Mathematica code instead of picture. $\endgroup$
    – cvgmt
    Nov 13, 2022 at 2:17

2 Answers 2

0
$\begingroup$

Your question is not clear. I assume you want to plot the values of f and g for fixed z as a function of x and y in one single plot. This can be done e.g. by:

f[x_, y_, z_] = x^2 + y^2 - z^3;
g[x_, y_, z_] = (x^2 - y^2) z^3;
ff[z_] := 
 Plot3D[f[x, y, z], {x, 0, 1}, {y, 0, 1}, PlotStyle -> Green]
gg[z_] := Plot3D[g[x, y, z], {x, 0, 1}, {y, 0, 1}, PlotStyle -> Red]
Manipulate[Show[ff[z], gg[z]], {z, 0, 1}]

enter image description here

$\endgroup$
0
$\begingroup$

Show is generally not needed when combining the same type of plots (e.g., both Plot3D).

$Version

(* "13.1.0 for Mac OS X x86 (64-bit) (June 16, 2022)" *)

Clear["Global`*"]

f[x_, y_, z_] = x^2 + y^2 - z^3;
g[x_, y_, z_] = (x^2 - y^2) z^3;

Manipulate[
 Plot3D[
  {f[x, y, z], g[x, y, z]},
  {x, 0, 1}, {y, 0, 1},
  PlotStyle -> {Green, Red},
  AxesLabel -> (Style[#, 14] & /@ {x, y}),
  PlotLegends -> (Style[#, 16] & /@ {f, g})],
 {{z, 0.8}, 0, 1, 0.01, Appearance -> "Labeled"}]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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