add tuple support
adapt plot.py