Add comments to linear visualization function