If I'm not mistaken, when you enter an expression on an attribute, you are actually creating an expression node which is in fact executing MEL code. You have access to special variables like "time" and "frame", and you can set numerical values by just using the nodeName.attribute syntax, rather than setAttr and getAttr commands, but apart from that, you are still just executing MEL. You can access the expression from Windows -> Animation Editors -> Expression Editor.
I'm still a bit confused by what you mean by "plotting" a surface. Your example sin(x) * tan(y) is a multivariable function, so it should produce a surface, not a line. You could set up an expression to give you the value of sin(x) * tan(y) on the z axis as you move the locator through space. Then you could animate the locator to move around the domain of x and y.
locator1.tz = sin(locator.tx) * tan(locator.ty);
Maya will not, however, generate a surface for you with an expression.