In my dataset, I have a Price
column for house prices and 5 dummy columns for different locations in the city. What I want to do is to show data points on the scatter plot with different colors.
For instance, on a scatter plot including all the prices of the houses, I want to have:
- Red for all price points when
dummy1
which indicates house being inArea1
is equal to 1. - Blue for all price points when
dummy2
which indicates house being inArea2
is equal to 2.
and so on until the last column. How can I create that plot? I can create the scatter plot without the color using plt.scatter()
but don't know how to add the color code.