| 1 | initial version |
You can use plot3d to plot your surface and then add to that Graphics object the collection of points you want to visualize:
sage: N = 3
sage: f(x,y)=x^2+y^2
sage: G = plot3d(f, (x,-N,N), (y,-N,N))
sage: points = [ (a,b,f(a,b)) for a in [-N..N] for b in [-N..N] ]
sage: G += sum(point(points, color='red'))
sage: show(G)
| 2 | No.2 Revision |
You can use plot3d to plot your surface and then add to that Graphics object the collection of points you want to visualize:
sage: N = 3
sage: f(x,y)=x^2+y^2
sage: G = plot3d(f, (x,-N,N), (y,-N,N))
sage: points points_list = [ (a,b,f(a,b)) for a in [-N..N] for b in [-N..N] ]
sage: G += sum(point(points, color='red'))
point(points_list, color='red')
sage: show(G)
| 3 | No.3 Revision |
You can use plot3d to plot your surface and then add to that Graphics object the collection of points you want to visualize:
sage: N = 3
sage: f(x,y)=x^2+y^2
sage: G = plot3d(f, (x,-N,N), (y,-N,N))
sage: points_list = [ (a,b,f(a,b)) for a in [-N..N] for b in [-N..N] ]
sage: G += point(points_list, color='red')
sage: show(G)
Here's a working demo:
http://aleph.sagemath.org/?q=784f1e88-2b61-4dd1-aa80-fb5fc0a74d70&lang=sage
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.