Thanks Jason, now I tried to implement such a True/False function in order to multiply it with the actual plot function to carve out the wanted plot region. Below I defined the function as a callable object as requested by the plot command. In a print test the function works well. But when used in the plot3d function all I get is a flat plane at +1 height instead of a carved out rectangle at height +1 and a frame around it at 0 height. What is wrong? Is f in plot3d not evaluated for each set of parameters? roleic
######################## class plotregion: def __init__(self): pass def __call__(self,u,v,umin,umax,vmin,vmax): self.u,self.v,self.umin,self.umax,self.vmin,self.vmax = u,v,umin,umax,vmin,vmax if (self.u < self.umin or self.u > self.umax or self.v < self.vmin or self.v > self.vmax): return 0 else: return 1 ######################## g = plotregion() for i in range(7): for j in range(7): print g(i,j,1,6-j,1,5), print ######################## f = plotregion() plot3d(f(u,v,1,4,1,3),(u,-2,6),(v,-2,6)) ######################## --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---