Chernoff faces are a whimsical data visualization technique invented by Hermann Chernoff, exploiting the ability of human brains to recognize small differences in facial features easily.
This simple library uses matplotlib and adapts an earlier version by Abraham Flaxman (@aflaxman). As well as the traditional 18 variables, it adds hair.
I first learned of this technique from the novel Blindsight, by Peter Watts, which is excellent, and everyone should go and read. And I guess I should mention some criticisms of the technique. A good roundup is by Robert Kosara. Lee et al (see References) also found some empirical evidence that interpreting Chernoff Faces can actually be slow and inaccurate. So have a think about that too, if you're actually planning to use these in some serious context.
pip install -r requirements.txt
(I use a venv)
vec[EYE_SIZE] = precision
vec[EYEBROW_SLANT] = 1-simplicity
ax = fig.add_subplot(5,5,1+offset,aspect='equal')
cface(ax, *vec)
See pmqfaces.py
for a full working example.
Herman Chernoff, The Use of Faces to Represent Points in K-Dimensional Space Graphically, Journal of the American Statistical Association, vol. 68, no. 342, pp. 361โ368, 1973.
Lee, M. D., Reilly, R. E., & Butavicius, M. E. (2003). An empirical evaluation of Chernoff faces, star glyphs, and spatial visualizations for binary data. Proceedings of the Asia-Pacific Symposium on Information Visualisation - Volume 24, 1โ10.