fix a drawing bug in 2D plot