在Python中绘制分段流图

问题描述 投票:1回答:1

我需要绘制分段流图,如果我的矢量场由]定义>

def f(x):
    if x<= 2:
        return 5/((3-2*(-x))**2)-((-18+(-x))*(-6+(-x)))/((-x)**4)
    else:
        return 5/((3-2*x)**2)-((-18+x)*(-6+x))/(x**4)

u = y

v = f(x)

我如何执行此绘图?

我需要绘制分段流图,如果我的矢量场由def f(x)定义:如果x <= 2:返回5 /(((3-2 *(-x))** 2)-( (-18 +(-x))*(-6 +(-x)))/((-x)** 4)否则:返回5 /(((3 -...

python matplotlib plot
1个回答
1
投票

使用np.piecewise定义功能和np.piecewise

© www.soinside.com 2019 - 2024. All rights reserved.