added legends to visualization