how to do it?

This is the full script that the test.las file to visualize it with mathplotlib.

import numpy as np
import laspy
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt

input_las = laspy.file.File("test.las", mode="r")
point_records = input_las.points.copy()

lasScaleX = input_las.header.scale[0]
lasOffsetX = input_las.header.offset[0]
lasScaleY = input_las.header.scale[1]
lasOffsetY = input_las.header.offset[1]
lasScaleZ = input_las.header.scale[2]
lasOffsetZ = input_las.header.offset[2]

p_X = np.array((point_records['point']['X'] * lasScaleX) + lasOffsetX)
p_Y = np.array((point_records['point']['Y'] * lasScaleY) + lasOffsetY)
p_Z = np.array((point_records['point']['Z'] * lasScaleZ) + lasOffsetZ)

fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.scatter(p_X, p_Y, p_Z, c='r', marker='o')
plt.show()

LAS and laspy specfic code

input_las = laspy.file.File("test.las", mode="r")
point_records = input_las.points.copy()

The first function opens the test.las file in read only mode. With the second function all points with there attributes are conveniently copied to an array. This way we can access all X,Y and Z values at once.