-1

I tried to plot some figures inside a for loop from jupyter notebook:

for i in range(4):
    df = pd.DataFrame()
    df['x'] = features[:, 0]
    df['y'] = features[:, 1]

    plt.plot(df["x"], df["y"])
    plt.show()

I got the following for the first figure. Do you know what is the problem please?

enter image description here

Trenton McKinney
  • 56,955
  • 33
  • 144
  • 158
Avv
  • 429
  • 4
  • 17

1 Answers1

1

Use pyplot.scatter() for scatter graph and pyplot.plot() for line graph.

4b0
  • 21,981
  • 30
  • 95
  • 142
sam2611
  • 455
  • 5
  • 15