【发布时间】:2015-12-09 14:03:57
【问题描述】:
我希望重新创建this link 中显示的这些图表:
我需要以正确的顺序排列它们,而且我也不确定每个图表需要使用哪些 k 值。 我尝试了几个 k 值,但似乎无法正确。我的代码如下所示。 任何帮助都会很棒,谢谢。
#define parameters
k1= np.linspace(0,1,2)
k2=1
n1=3
n2=3
K1=0.3
K2=0.3
beta1=0
beta2=0.05
x = np.linspace(0,1)
def r_inact_1loop(x,k1=1): #np.linspace(10,0,0.5)): #k1=1
return k1*x
def r_activation(x,k1=1): #np.linspace(0,1,2.5))
return k2*(beta2*K2**n2/(K2**n2+x**n2) + x**n2/(K2**n2+x**n2))*(1-x)
def r_inact_2loop(x,k1=1): #np.linspace(2.5,0,1)):
return k1*(beta1*x**n1/(K1**n1+x**n1) + K1**n1/(K1**n1+x**n1))*x
#graphs
fig = plt.figure(figsize=(16,5))
ax1 = fig.add_subplot(1,3,1)
ax2 = fig.add_subplot(1,3,2)
ax3 = fig.add_subplot(1,3,3)
ax1.set_xlabel('Fraction of activated A')
ax2.set_xlabel('Fraction of activated A')
ax3.set_xlabel('Fraction of activated A')
ax1.set_ylabel('Rate of A inactivation or activation')
ax2.set_ylabel('Rate of A inactivation or activation')
ax3.set_ylabel('Rate of A inactivation or activation')
for k in k1: #k1
ax1.plot(x, r_inact_1loop(x,k),label='in1 k1={:.1f}'.format(k))
ax1.plot(x, r_activation(x,k),label='ac k1={:.1f}'.format(k))
#ax1.legend(loc='best')
ax2.plot(x, r_inact_1loop(x,k),label='in1 k1={:.1f}'.format(k))
ax2.plot(x, r_inact_2loop(x,k),label='in2 k1={:.1f}'.format(k))
#ax2.legend(loc='best')
ax3.plot(x, r_activation(x,k),label='ac k1={:.1f}'.format(k))
ax3.plot(x, r_inact_2loop(x,k),label='in2 k1={:.1f}'.format(k))
#ax3.legend(loc='best')
plt.xlim(0,1)
plt.ylim(0,0.7)
plt.show()
【问题讨论】:
标签: python-3.x matplotlib graph