For a piecewise function
f(x,y) = x < 0 ? 0 : 0 <= x && x < 1 && x*y < 1 ? x : 1
which breaks down to following in Mathematica language
f(x,y) = 0 if x < 0
f(x,y) = x if 0 <= x < 1 & xy < 1
f(x,y) = 1 otherwise
I want to make the density plot, which should look like the following figure
How to go about it? I tried doing it like this
set hidden3d
set dgrid3d 50,50 qnorm 2
set view map
splot f(x,y)
which I know is incorrect.
Edit: Earlier, by mistake I wrote xy < 1
instead of x*y < 1
when defining piecewise function. I have corrected that.