0

I want the y-axis to be able to display the actual price instead of values with decimals going only up to one.

sns.pairplot(train,
             x_vars=['distance_travelled(kms)', 'car_age', 'year', 'brand_rank'],
             y_vars='price',
             height=5,
             aspect=0.7);

train is the name of the df.

This is the visualization I keep getting instead of the actual values:

A view of the information in the dataset:

tdy
  • 36,675
  • 19
  • 86
  • 83
  • 1
    describe problem in question's body, not in title - it will be more visible. – furas Oct 24 '22 at 10:01
  • 1
    better create `minimal working code` with example data in code - so we could simply copy and test it. And show what values you want to see on plot - you could even create image for this. – furas Oct 24 '22 at 10:03
  • Thanks, im still new to the platform so im still learning my way around it – obakeng othusitse Oct 24 '22 at 12:29

1 Answers1

0

I got this working by doing this

g = sns.pairplot(train, x_vars=['distance_travelled(kms)','car_age', 'year','brand_rank'], y_vars= 'price', height= 5, aspect= 0.7);
for ax in g.axes.flatten():
  ax.yaxis.get_major_formatter().set_scientific(False)
  ax.yaxis.get_major_formatter().set_useOffset(False)
plt.show()  

Didnt have the dataframe, so just made a dummy. But should work for you

vegiv
  • 124
  • 1
  • 9