1

I'm struggling to plot different scatter plots on one graph for a set of data in a data frame so that it'll show price versus area for different property types: Residential, Commercial and Industrial.

The Dataframe currently looks like this:

property_type   area    actual_worth    
Commercial      59.92   161250.0
Commercial      50.00   160000.0
Residential     40.50   123400.0
Industrial      35.49   61250.0
Industrial      24.30   125000.0
Commercial      90.12   69700.0 

Thanks,

R

Renaldo Moon
  • 165
  • 3
  • 14

1 Answers1

1

You should look into seaborn.FacetGrid for easy control of these types of plots.

Here's a very simple example based on your sample data:

import seaborn as sns

g = sns.FacetGrid(df, row='property_type')
g.map(sns.scatterplot, 'area', 'actual_worth')

enter image description here

Chris Adams
  • 18,389
  • 4
  • 22
  • 39