Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168742
Image: ubuntu2004
N=10 pop_size=[] lam=1.2 for t in range(10): pop_size.append([t,N]) N=N*lam points(pop_size)
line??

File: /usr/local/sage2/local/lib/python2.6/site-packages/sage/plot/line.py

Source Code (starting at line 226):

def line(points, **kwds):
    """
    Returns either a 2-dimensional or 3-dimensional line depending
    on value of points.

    For information regarding additional arguments, see either line2d?
    or line3d?.

    EXAMPLES::

        sage: line([(0,0), (1,1)])
        sage: line([(0,0,1), (1,1,1)])
    """
    try:
        return line2d(points, **kwds)
    except ValueError:
        from sage.plot.plot3d.shapes2 import line3d
        return line3d(points, **kwds)
from random import gauss def exponential (N, r): return N * (r + gauss(0,0.5)) time = 100. n0 = 100 pop_sizes = [n0] for years in range(1, time): pop_sizes.append(exponential(pop_sizes[-1], 1.1)) series = [] for p in range(len(pop_sizes)): series.append([p, pop_sizes[p]]) line(series, marker='.') + text('time', (50,-150), color 'black')