Reputation: 706
I am going to plot the results of a for loop
and if statement
inside of it.
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. What should I do to have plot of Unu
vs nu
with lines not dots?
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()
Upvotes: 0
Views: 98
Reputation: 39052
You code is not runnable but you can do something along the following lines:
nu
and 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()
Upvotes: 1