add codes for barPlot3d