![](/img/trans.png)
[英]Matplotlib Plot Dashed Circles (using plt.plot instead of plt.scatter)
[英]Matplotlib makes empty plot using plt.plot but shows the plot using plt.scatter
我要去 plot 的結果for loop
和它里面的if statement
。
I want to have plot with lines but once I use plt.plot
the plot will be empty but once I try scatter
I have plot with dots. 我應該怎么做才能讓Unu
vs nu
的 plot 用線而不是點?
if inp==0:
print('***')
print('0 Is not acceptable ')
print('***')
else:
for xx in range(1,819):
...# lines of code
if inp<0:
if lim > 1:
pass
else:
nu = dfimppara.iloc[xx, 1] *115
plt.scatter(Unu(xx), nu)
else:
...# lines of code
plt.show()
您的代碼不可運行,但您可以執行以下操作:
nu
和Unu(xx)
if inp==0:
print('***')
print('0 Is not acceptable ')
print('***')
else:
nu_list = []
Unu_list = []
for xx in range(1,819):
...# lines of code
if inp<0:
if lim > 1:
pass
else:
nu_list.append(dfimppara.iloc[xx, 1] *115)
Unu_list.append(Unu(xx))
plt.plot(Unu_list, nu_list)
else:
...
plt.show()
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.