# Regarding a contour plot [closed]

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$$.

## 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.

• Please phrase your question as a question and provide code showing where you are getting stuck. – bobthechemist Dec 20 '18 at 20:40

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]]


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]]


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