Please enable Javascript to view the contents

拖网选择性曲线

 ·  ☕ 1 分钟  ·  👽 Guankui

拖网S型曲线

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import numpy as np
from scipy import stats
import matplotlib.pyplot as plt

fig = plt.figure()
ax = fig.add_subplot(111)

x = np.linspace(0, 650, 1000)
xbar = -50
xvar = 10
for age in np.arange(1, 6):
    xbar += 100
    xvar += 10
    y = stats.norm.pdf(x, xbar, xvar)
    ax.plot(x, y, c = 'b')
    ax.text(xbar, max(y)*1.05, 'Age ' + str(age), ha = 'center', fontsize = 12, c = 'b', fontweight = 'bold')

ax.tick_params(axis='y', colors='b')
ax.set_ylabel('Fish abundance ($Kg$)', fontsize = 13, c = 'b', fontweight = 'bold')
ax.set_yticks([0, 0.01, 0.02, 0.03], ['$1.0^7$', '$1.1^7$', '$1.2^7$', '$1.3^7$'])

ax.set_xlabel('Fish Size', fontsize = 15,  fontweight = 'bold')
ax.axes.xaxis.set_ticks([])
ax.spines['right'].set_visible(False)
ax.spines['top'].set_visible(False)
ax.spines['bottom'].set_linewidth(2)
ax.spines['left'].set_color('b')
ax.spines['left'].set_linewidth(2)
ax.set_xlim(0, 620)
ax.set_ylim(0, 0.03)

ax2 = ax.twinx()
ax2.plot(np.arange(600), 1/(1+np.exp(0.02*(250-np.arange(600)))), color = 'r', lw = 2)
ax2.spines['top'].set_visible(False)
ax2.spines['right'].set_visible(True)
ax2.spines['right'].set_color('red')
ax2.spines['right'].set_linewidth(2)
ax2.tick_params(axis = 'y', colors = 'r')
ax2.set_ylabel('Selective probability', fontsize = 13, c = 'r', fontweight = 'bold', labelpad = 10)

png

分享

Guankui Liu
作者
Guankui
My research interests include statistics, computer vision and ecological modelling.