Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How do i plot a piecewise function with functional constraints?

I have to plot a function T(x,x) which equals xy if xy>0 and x+y otherwise. I have defined the function:

def T(x,y):
   if (x*y>0):
    return x*y
   else:
    return x+y

but it does not work.