просто для удовольствия, используя numpy, который по умолчанию обходит вашу исходную проблему с передачей строк в matplotlib, и в то же время немного уплотняя код.
raw = """
id,gx,gy,gz,ax,ay,az
0,4.47,-33.23,-77,-106,94
1,-129.04,4.48,-33.22,-78,-94,117
2,-129.04,4.49,33.2,-70,-81,138
3,-129.02,4.49,-33.18,-70,-64,157
4,-129.02,4.5,-33.15,-64,-47,165
"""
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
from io import StringIO
# read data
csvfile = StringIO(raw)
d = plt.np.loadtxt(csvfile, delimiter=',', skiprows=2, usecols=[1,2,3])
# instead of csvfile just use filename when using the real file
xyz = plt.np.split(d.T, indices_or_sections=len(d.T))
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.scatter(*xyz, c='r', marker='o')
ax.set(**{'%slabel'%s: s.upper() + ' Label' for s in 'xyz'})