I want to splot the function exp(-(x²+y²)) alone and under the constraint of x+y-1=0. The result should be the surface alone as well as a line with a maximum at x=y=0.5. Or in other words, it's the intersection of the function with a (110)-plane.
What I came up so far is something like
f(x,y)=exp(-(x**2+y**2))
g(x,y)=( (x+y-1==0)? f(x,y) : (1/0) )
splot f(x,y), g(x,y)
with and without with lines for g(x,y), but I could not get g(x,y) being displayed - I only see f(x,y). Additionally, I get the very informative error messages:
Error: Key "<META>" added to modifier map for multiple modifiers; Using Mod4, ignoring Mod1
Error: Symbol "Meta_L" added to modifier map for multiple modifiers; Using Mod4, ignoring Mod1
Any ideas?
This is not a 3-dimensional plot because you only have one independent variable. The value of
y
is fixed byx+y-1=0
. Therefore, you have to plotf(x,y)=exp(-(x**2+y**2))
evaluated atf(x,1-x)
:Now, of course the above graph is the projection of your curve onto the XZ plane. If you want the 3-dimensional view, then I would recommend a numerical evaluation of the function using the special file name
"+"
:You can visualize the intersection with your surface: