# How do i plot a piecewise function with functional constraints?

I have to plot a function T(x,x) which equals x*y if x*y>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.