Home > Software design >  Why is scatter plot not showing all points?
Why is scatter plot not showing all points?

Time:01-12

This is my code:

    from matplotlib import pyplot as plt
    import pandas as pd
    df = pd.DataFrame({'in': [3009861162, 548584145, 950178496, 984257236, 447403092, 447403094, 445305942, 445306198, 2592658903, 2592921015, 2592920999],
                       'out': [2917869018, 622408909, 621393093, 749384917,782939349, 2930425029, 2930425313, 2930425249, 2393546529, 2527846001, 3601419873]})
    plt.scatter(df['in'], df['out'], color='red')
    plt.show()

And the output is:

enter image description here

CodePudding user response:

All your 11 points are displayed, but three of them are overlapping.

This is easily visible if you set 33% transparency (top left point):

plt.scatter(df['in'], df['out'], color='red', alpha=0.33)

enter image description here

  •  Tags:  
  • Related