add setlegends command