I have data comprising of 3 columns:
zone | pop1 | pop2
---- ---- ----
3 4500 3800
2 2800 3100
1 1350 1600
2 2100 1900
3 3450 3600
I would like to draw a scatter plot of pop1
and pop2
, with the circles having colors based on the value of zone
.
I have the following code so far:
df = pd.read_csv(file_path)
plt.scatter(df['pop1'],df['pop2'], s = 1)
How can I give different colors, let's say red, green and blue, corresponding to zone values 1, 2 and 3 respectively?