Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168744
Image: ubuntu2004
#Madison Schaeffer # -*- coding: utf-8 -*- # import libraries from math import exp import matplotlib.pyplot as plt from random import uniform #define functions def cont_log_time(N,r,K): return N + N*r*(1-(N/K)) # declare data N = 100 r = 3.0 K = 1000 time = 50 pop_size = [N] pop_sizeY=[] # main for years in range(1,time): pop_size.append(cont_log_time(pop_size[-1], r, K)) for values in range(len(pop_size)-1): pop_sizeY.append(pop_size[values+1]) pop_size.pop(-1) plt.plot(pop_size,pop_sizeY) plt.show() # [Mike] Minor point, Can you plot without # the lines connecting the dots? #plot with no lines: #pop_size.pop(-1) #plt.plot(pop_size,pop_sizeY, marker = '.',linestyle = 'none') #plt.show()
No object 'dots' currently defined.