用Matplotlib绘制Python图形

2024-05-16 22:15:58 发布

您现在位置:Python中文网/ 问答频道 /正文

我不熟悉Python和matplotlib。我试着用Python绘制方程图,但做不到。你能帮我找出哪里做错了吗?在

我的代码在这里:

import matplotlib.pyplot as plt

def plotgraph ():
    T = -14
    index = 0
    ro = []
    while(T<=14):
        ro.append( 1000 - ((T-4)*(T-4)) / 180)
        T = T + 0.001
        plt.plot(ro[index],T)
        index = index +1
    return

plotgraph()
plt.show()

Tags: 代码importindexroplotmatplotlibdefas