fix minor bug in plotting.