pandas scatter plot not showing all data

Viewed 4333

I am new to pandas data visulaizations and I'm having some trouble with a simple scatter plot. I have a dataframe loaded up from a csv, 6 columns, and 137 rows. But when I try to scatter the data from two columns, I only see 20 datapoints in the generated graph. I expected to see all 137. Any suggestions?

Here is a tidbit of code:

import pandas as pd
import matplotlib.pyplot as plt
plt.style.use('ggplot')
df = pd.read_csv(file, sep=',', header=0)
df.plot.scatter(x="Parte_aerea_peso_fresco", y="APCEi", marker=".")

And here is the output. enter image description here

1 Answers

Possibility 1) Many points are on exactly the same spot. You can manually check in your file.csv

Possibility 2) Some value are not valid i.e : NaN ( not a number ) or a string, ...

Your dataframe is small: You can check this possibility by printing your DataFrame.

print (df)   
print (df[40:60])    
df.describe()
Related