legend -> caption; cosmetic changes in documentation