plot

c
chebyshev
楼主 (未名空间)

import numpy as np
import pylab
import matplotlib.pyplot as plt

#https://en.wikipedia.org/wiki/Timeline_of_the_2019%E2%80%9320_Wuhan_
coronavirus_outbreak#Case_statistics
x = [45,62,121,198,291,440,571,830,1287,1975,2744,4515,5974,7711,9692,11791,14380,17205,20438,24324,28018,31161,34546,37198,40171,42638,44656,58761,
63851,66492,68500]

#b1^2 = 2
b1 = 2**(0.5)

#b2^6 = 2
b2 = 2**(1.0/6.0)

#b3^6 = 3
b3 = 2**(1.0/3.0)

a1 = [x[0]*pow(b1, i) for i in range(len(x))]
a3= [x[0]*pow(b2, i) for i in range(len(x))]
a2= [x[0]*pow(b3, i) for i in range(len(x))]

x = np.asarray(x)
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
line, = ax.plot(x,'o', color='red', lw=4,label="confirmed cases")
line, = ax.plot(a1,'-', color='blue', lw=1,label="doubled each two days")
line, = ax.plot(a2,'-', color='blue', lw=1,label="doubled each three days")
line, = ax.plot(a3,'-', color='blue', lw=1,label="doubled each six days")

ax.legend()
ax.set_yscale('log')
pylab.show()

c
chebyshev

Sigapore
【 在 chebyshev (......) 的大作中提到: 】
: import numpy as np
: import pylab
: import matplotlib.pyplot as plt
: #https://en.wikipedia.org/wiki/Timeline_of_the_2019%E2%80%9320_Wuhan_
: coronavirus_outbreak#Case_statistics
: x = [45,62,121,198,291,440,571,830,1287,1975,2744,4515,5974,7711,9692,
11791,
: 14380,17205,20438,24324,28018,31161,34546,37198,40171,42638,44656,58761,
: 63851,66492,68500]
: #b1^2 = 2
: b1 = 2**(0.5)
: ...................

c
chebyshev

recovered
【 在 chebyshev (......) 的大作中提到: 】
: import numpy as np
: import pylab
: import matplotlib.pyplot as plt
: #https://en.wikipedia.org/wiki/Timeline_of_the_2019%E2%80%9320_Wuhan_
: coronavirus_outbreak#Case_statistics
: x = [45,62,121,198,291,440,571,830,1287,1975,2744,4515,5974,7711,9692,
11791,
: 14380,17205,20438,24324,28018,31161,34546,37198,40171,42638,44656,58761,
: 63851,66492,68500]
: #b1^2 = 2
: b1 = 2**(0.5)
: ...................