Ticket #3853: trac_3853-fixes.2.patch
| File trac_3853-fixes.2.patch, 3.3 kB (added by mhansen, 4 months ago) |
|---|
-
a/sage/plot/all.py
old new 1 from plot import (Graphics, line, polygon, plot, point, points,1 from plot import (Graphics, line, line2d, polygon, plot, point, points, point2d, 2 2 text, circle, disk, hue, graphics_array, 3 3 list_plot, networkx_plot, parametric_plot, 4 4 polar_plot, contour_plot, implicit_plot, arrow, -
a/sage/plot/plot.py
old new 2333 2333 sage: E = EllipticCurve('37a') 2334 2334 sage: P = E(0,0) 2335 2335 sage: def get_points(n): 2336 ... .:return sum([point((i*P)[0:2], pointsize=3) for i in range(-n,n) if i != 0 and (i*P)[0] < 3])2336 ... return sum([point((i*P)[0:2], pointsize=3) for i in range(-n,n) if i != 0 and (i*P)[0] < 3]) 2337 2337 sage: sum([get_points(15*n).plot3d(z=n) for n in range(1,10)]) 2338 2338 """ 2339 2339 from sage.plot.plot3d.base import Graphics3dGroup … … 2665 2665 pass 2666 2666 2667 2667 if len(points)>0 and len(list(points[0]))!=2: 2668 print points2669 2668 raise ValueError, "points must have 2 coordinates in a 2d line" 2670 2669 2671 2670 … … 2947 2946 return contour_plot(f, xrange, yrange, **options) 2948 2947 2949 2948 def line(points, **kwds): 2949 """ 2950 Returns either a 2-dimensional or 3-dimensional line depending 2951 on value of points. 2952 2953 For information regarding additional arguments, see either line2d? 2954 or line3d?. 2955 2956 EXAMPLES: 2957 sage: line([(0,0), (1,1)]) 2958 sage: line([(0,0,1), (1,1,1)]) 2959 """ 2960 try: 2961 return line2d(points, **kwds) 2962 except ValueError: 2963 from sage.plot.plot3d.shapes2 import line3d 2964 return line3d(points, **kwds) 2965 2966 def line2d(points, **kwds): 2950 2967 r""" 2951 2968 Create the line through the given list of points. 2952 2969 … … 3212 3229 return g 3213 3230 3214 3231 def point(points, **kwds): 3232 """ 3233 Returns either a 2-dimensional or 3-dimensional point depending 3234 on value of points. 3235 3236 For information regarding additional arguments, see either point2d? 3237 or point3d?. 3238 3239 EXAMPLES: 3240 sage: point([(0,0), (1,1)]) 3241 sage: point([(0,0,1), (1,1,1)]) 3242 """ 3243 try: 3244 return point2d(points, **kwds) 3245 except ValueError: 3246 from sage.plot.plot3d.shapes2 import point3d 3247 return point3d(points, **kwds) 3248 3249 3250 def point2d(points, **kwds): 3215 3251 r""" 3216 3252 3217 3253 A point of size `pointsize' defined by point = $(x,y)$. … … 3629 3665 sage: text("Sage is really neat!!",(2,12)) 3630 3666 3631 3667 The same text in larger font and colored red: 3632 sage: text 3d("Sage is really neat!!",(2,12),fontsize=20,rgbcolor=(1,0,0))3668 sage: text("Sage is really neat!!",(2,12),fontsize=20,rgbcolor=(1,0,0)) 3633 3669 3634 3670 Some text but guaranteed to be in the lower left no matter what: 3635 3671 sage: text("Sage is really neat!!",(0,0), axis_coords=True, horizontal_alignment='left')