matplotlib不显示resu

2024-09-29 19:30:32 发布

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

当我运行这个小程序(一个小实验来观察所选向量的线性变换)时,mac上的python启动程序图标开始通过在dock上弹跳来激活自己,但随后什么也没有显示。有什么问题

import matplotlib.pyplot as plt
def linear_transformation(up_sx,up_dx,down_sx,down_dx):
    x_vect_val=(input('what is the X value of the vector?'))
    y_vect_val=(input('what is the Y value of the vector?'))
    x_vect_transfval=str((int(x_vect_val)*str(up_sx))+(int(y_vect_val)*str(up_dx)))
    y_vect_transfval=str((int(x_vect_val)*str(down_sx))+(int(y_vect_val)*str(down_dx)))
    xvals=[x_vect_val,x_vect_transfval]
    yvals=[y_vect_val,y_vect_transfval]
    plt.plot(xvals,yvals)
    plt.show

这可能是我不知道的愚蠢的原因,我是一个初学者

线性变换(1,2,0,1)

the icon activating


Tags: the程序inputispltvalwhatint

热门问题