code: func getFromLegend(legend []string, param, def string) string {
  	for _, s := range legend {
  		if strings.HasPrefix(s, param) {
  			return s[len(param):]
  		}
  	}
  	return def
  }
docs: // getFromLegend returns the suffix of an entry in legend that starts
  // with param.  It returns def if no such entry is found.