Home > Blockchain >  Cannot see the points in my scatter plot despite having R value
Cannot see the points in my scatter plot despite having R value

Time:11-27

I am facing this exact same issue. I am using a csv file with the missing rows dropped to make my scatter plot. I have also use matplotlib yet I am getting not output despite having the R value.

mc_corr=cars2_1["City_Mileage_km_litre"].corr(cars2_1['Fuel_Tank_Capacity_litre'])
plt.scatter(cars2_1["City_Mileage_km_litre"],cars2_1['Fuel_Tank_Capacity_litre'],color='orange')
plt.title('Mileage vs Fuel Tank Capacity')
plt.xlim(5,35)
plt.ylim(3.5,10.0)
plt.xlabel("R = " str(mc_corr))
plt.show()

Output

The data set:

Input

CodePudding user response:

Your ylim is too short for values to fall into, change:

plt.ylim(3.5,10.0)

to

plt.ylim(24,88)
  • Related