Issue
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()
The data set:
Solution
Your ylim is too short for values to fall into, change:
plt.ylim(3.5,10.0)
to
plt.ylim(24,88)
Answered By - manaclan
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.