Generalized legends.  Fixes #15.