plot histogram function