Sono nuovo in pitone. Voglio generare le linee, che ottengo da un array in 3D.Come posso creare una semplice linea 3D con Matplotlib?
Ecco il codice:
VecStart_x = [0,1,3,5]
VecStart_y = [2,2,5,5]
VecStart_z = [0,1,1,5]
VecEnd_x = [1,2,-1,6]
VecEnd_y = [3,1,-2,7]
VecEnd_z =[1,0,4,9]
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.plot([VecStart_x ,VecEnd_x],[VecStart_y,VecEnd_y],[VecStart_z,VecEnd_z])
plt.show()
Axes3D.plot()
ho allways ottenere questo errore:
ValueError: terzo arg deve essere una stringa di formato
Apprezzo il vostro aiuto.
Che risolto. Grazie. –