fix a bug in plot bar