Message Boards Message Boards

Plot a function with x, y and a variable?

GROUPS:

I'm trying to plot a function with x, y and a variable. The code worked when I did a contour plot, but now I need a regular plot. Can somebody tell me what is wrong?

p1=Import["....xlsx"][[1]];
Stressfunc1 = LinearModelFit[p1, {1, x, y, x^2, x*y, y^2, x^3, x^2*y, x*y^2, y^3}, {x, y}];
Stressfunc1r = Stressfunc1["BestFit"]
Plot[Stressfunc1r, {x, 0, 1.4}, PlotLegends -> True, PlotLabel -> "A11 for Mesh 1", FrameLabel -> {"x", "y"}]
POSTED BY: Ellen vdE
Answer
8 days ago

It is not clear what a regular plot is when you have a function of two variables. You may draw a single contour:

ContourPlot[Stressfunc1r, {x, 0, 1.4}, {y, 0, 1}, PlotLegends -> True,
  PlotLabel -> "A11 for Mesh 1", FrameLabel -> {"x", "y"}, 
 Contours -> {{.5}}, ContourShading -> None]
POSTED BY: Gianluca Gorni
Answer
7 days ago

Group Abstract Group Abstract