轴不在情节上

轴不在情节上,第1张

概述我一直在尝试使用坐标显示区域.当我将坐标直接输入到列表中时,它将显示该区域.但是,当我使用变量时,它没有.#plotting a triangle using coordinates print('Enter the coordinates') Na = input('Northings of A = ') Ea = input('Eastings of A

我一直在尝试使用坐标显示区域.
当我将坐标直接输入到列表中时,它将显示该区域.
但是,当我使用变量时,它没有.

#plotting a triangle using coordinatesprint('Enter the coordinates')Na = input('northings of A = ')Ea = input('Eastings of A = ')Nb = input('northings of B = ')Eb = input('Eastings of B = ')Nc = input('northings of C = ')Ec = input('Eastings of C = ')import matplotlib.pyplot as pltx = [Ea,Eb,Ec,Ea]y = [Na,Nb,Nc,Na]plt.plot(x,y,'yellow')plt.show()x = [1500,1720,1244.52,1500]y = [5930.15,6230.25,3254.62,5960.15]plt.plot(x,'purple')plt.show()
最佳答案我认为从输入强制转换为int是一个问题,并且缺少Nd和Ed变量.

print('Enter the coordinates')Na = input('northings of A = ')Ea = input('Eastings of A = ')Nb = input('northings of B = ')Eb = input('Eastings of B = ')Nc = input('northings of C = ')Ec = input('Eastings of C = ')Nd = input('northings of D = ')Ed = input('Eastings of D = ')import matplotlib.pyplot as pltx = [int(Ea),int(Eb),int(Ec),int(Ed)]y = [int(Na),int(Nb),int(Nc),int(Nd)]plt.plot(x,'green')plt.show()x = [1500,'purple')plt.show()
总结

以上是内存溢出为你收集整理的轴不在情节上 全部内容,希望文章能够帮你解决轴不在情节上 所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/1199637.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-04
下一篇 2022-06-04

发表评论

登录后才能评论

评论列表(0条)

保存