Handling over-plotting and outlier values by managing opacity, symbols, and scales
Let's say we are now interested in seeing the relationship between our variable and population for the same year that we have been working on. We want to have Population, total
on the x-axis, and perc_pov_19
on the y-axis.
We first create a subset of poverty
where year
is equal to 2010, and is_country
is True
, and sort the values using Population, total
:
df =\ poverty[poverty['year'].eq(2010) & poverty['is_country']].sort_values('Population, total')
Let's now see what it looks like when we plot those two variables. Here is the code:
px.scatter(df, y=perc_pov_19, x='Population, total', title=' - '.join([perc_pov_19, '2010&apos...