-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmatplotlib_log.py
More file actions
41 lines (29 loc) · 700 Bytes
/
matplotlib_log.py
File metadata and controls
41 lines (29 loc) · 700 Bytes
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
40
41
# coding:utf-8
"""
@Function:
用4种不同的坐标系绘制低通滤波器的频率响应,
存在latex字体问题
@author: Minxu
@date: 2017-12-19
"""
import numpy as np
import matplotlib.pyplot as plt
plt.rcParams["axes.unicode_minus"] = False
def four_diff_filter():
w = np.linspace(0.1, 1000, 1000)
p = np.abs(1/(1+0.1j*w))
plt.subplot(221)
plt.plot(w, p, lw = 2)
plt.ylim(0, 1.5)
plt.subplot(222)
plt.semilogx(w, p, lw = 2)
plt.ylim(0, 1.5)
plt.subplot(223)
plt.semilogy(w, p, lw = 2)
plt.ylim(0, 1.5)
plt.subplot(224)
plt.loglog(w, p, lw = 2)
plt.ylim(0, 1.5)
plt.show()
if __name__ == "__main__":
four_diff_filter()