import matplotlib.pyplot as plt
import numpy as np
# I will make up sample values of t
t = np.arange(1, 30, 2) # [1, 3, 5, ..29 1 to 29 increment by 2
A = 6 / ( 4+ t ** 2) # function 1
B = 6 / ( 4 + t ** 3) # function 2
C = 18/( 3 * t) # making up random function here as function 3
# red dashes, blue squares and green triangles
# think of this as (x, y , color/symbols)
plt.plot(t, A, 'r--', t, B, 'bs', t, C, 'g^')
plt.show()
1条答案
按热度按时间arknldoa1#
您可以使用
matplotlib
在同一个图形上绘制多个函数,有几种方法可以实现这一点。最简单的方法之一如图所示
你应该有这样的