code: def cmd_legend(self, args):
          '''setup legend for graphs'''
          if len(args) == 0:
              for leg in self.legend.keys():
                  print("%s -> %s" % (leg, self.legend[leg]))
          elif len(args) == 1:
              leg = args[0]
              if leg in self.legend:
                  print("Removing legend %s" % leg)
                  self.legend.pop(leg)
          elif len(args) >= 2:
              leg = args[0]
              leg2 = args[1]
              print("Adding legend %s -> %s" % (leg, leg2))
              self.legend[leg] = legf cmd_legend(self, args):
          '''setup legend for graphs'''
          if len(args) == 0:
              for leg in self.legend.keys():
                  print("%s -> %s" % (leg, self.legend[leg]))
          elif len(args) == 1:
              leg = args[0]
              if leg in self.legend:
                  print("Removing legend %s" % leg)
                  self.legend.pop(leg)
          elif len(args) >= 2:
              leg = args[0]
              leg2 = args[1]
              print("Adding legend %s -> %s" % (leg, leg2))
              self.legend[leg] = leg2
docs: setup legend for graphs