unorthodox123 / RacialDotMap

Python code for creating a dataset for a dot density map for every person in the U.S., color-coded by race and ethnicity.
253 stars 101 forks source link

Question on dot blending #4

Open csciuto opened 5 years ago

csciuto commented 5 years ago

Sorry if you get this twice, I wrote to the demographers without thinking it might be better to ask about the code! I was reading an article today talking about the incredible concentration of black people in jails, and how the Racial Dot Map reflects that. I was curious about my local jail, which showed up green (black) as predicted. However, my county is overwhelmingly white and then hispanic, so the incarceration rate for black people would have to be stratospheric. By finding the related Census data I was able to confirm that that institutionalized population for that area is in fact 70%+ white non-hispanic.

It's possible that data is wrong and the map is correct, but I am curious, so, I went digging into the code:

https://github.com/unorthodox123/RacialDotMap/blob/478f6fdb4b29bd54d3ff10e2b4933973738bc2a6/dotmap.pde#L179

If I'm reading this correctly, if the population density is so high you can't draw separate dots at max zoom, only the last dot is drawn since the transparency is set to zero. Since the dots are drawn in a certain order by race

https://github.com/unorthodox123/RacialDotMap/blob/master/dotfile.py#L155

you will pretty much always draw black people over white people, hispanic people over blacks, etc.

Does this make sense? If so, would it be possible to randomize either the writing to the CSV or the reading from it?

Thanks and Happy New Year,

Corey