-1
$\begingroup$

I have a function $ f(x, y) = \sin x\ \cos y\ \mathrm e^{x + y} $ (just an example) such that $ x + y \le 1 $ (both $ x $ and $ y $ are positive and $ 0 < x \le 1 $ and $ 0 < y \le 1 $).

I want to make a contour plot such that the contraint $ x + y \le 1 $ is taken into consideration. By this I mean that for the value of $ x = x_0 $ the values of $ f $ should be such that $ y = 1 - x_0 $.

$\endgroup$

closed as unclear what you're asking by corey979, bobthechemist, bbgodfrey, Niki Estner, Αλέξανδρος Ζεγγ Dec 25 '18 at 5:51

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 3
    $\begingroup$ Please phrase your question as a question and provide code showing where you are getting stuck. $\endgroup$ – bobthechemist Dec 20 '18 at 20:40
2
$\begingroup$
Plot3D[Sin[x] Cos[y] Exp[x + y], {x, 0, 1}, {y, 0, 1},
 RegionFunction -> Function[{x, y}, x + y < 1],
 MeshFunctions -> {#3 &}, Mesh -> 5,
 MeshStyle ->Directive[Thickness[0.01],Red]]

enter image description here

or

ContourPlot[Sin[x] Cos[y] Exp[x + y], {x, 0, 1}, {y, 0, 1},
 RegionFunction -> Function[{x, y}, x + y < 1],
 MeshFunctions -> {#3 &}, Mesh -> 5,
 MeshStyle -> Directive[Thickness[0.01], Red]]

enter image description here

$\endgroup$
  • $\begingroup$ Thank you @David G. Stork. Could you suggest some nice PlotLegend? $\endgroup$ – Zilch Dec 20 '18 at 14:05
  • $\begingroup$ Depends what you're trying to show: PlotLegend-> "my legend" or "Cost of soybeans in 1974" or whatever... $\endgroup$ – David G. Stork Dec 20 '18 at 14:07

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