我的情节不是从原点开始如何解决

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

我的以下代码正常运行,但是在最终图中存在一个问题,即我的原理图不是从共同原点开始的,而是从(0,0)开始,但并不是一个共同点。如何解决?

import matplotlib.pyplot as plt
import numpy as np
from numba import jit, cuda
@jit(target="cuda")
def func2(a):
        for i in range(10000000):
                a[i] += 1


if __name__ == "__main__":
        n = 10000000
        a = np.ones(n, dtype=np.float64)
        b = np.ones(n, dtype=np.float32)
r3=np.arange(1.1,10,0.1)
r1=1
r2=1.1
h=20
kconcrete=1.4
kins=5
R1cond=(1/(4*np.pi*kconcrete))*((1/r1)-(1/r2))
R2cond=(1/(4*np.pi*kins))*((r3-r2)/r2)
Rconv=1/(h*4*np.pi*r3**2)
Rtotal=R1cond+R2cond+Rconv
Rtotal=R1cond+R2cond+Rconv
plt.plot(r3-r2,R2cond,label="resistance of the insulation",color="orange")
plt.plot(r3-r2,Rconv,label="resistance of the convection",color="green")
plt.axhline(R1cond,label="resistance of the concrete",color="yellow")
plt.plot(r3-r2,Rtotal,label="total resistance",color="purple")
plt.legend()
plt.show()
python
1个回答
0
投票

您可以使用以下方式设置绘图的X和Y极限:

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