Aug-22-2018, 12:56 PM
(This post was last modified: Aug-22-2018, 12:56 PM by SchroedingersLion.)
Hey guys,
can someone explain to me this error?
"AttributeError: module 'matplotlib.pyplot' has no attribute 'zlim'"
I try to read in coordinates from a txt file. In each row, the coordinates are separated by a single tabulator.
can someone explain to me this error?
"AttributeError: module 'matplotlib.pyplot' has no attribute 'zlim'"
I try to read in coordinates from a txt file. In each row, the coordinates are separated by a single tabulator.
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import csv
fig=plt.figure()
ax=fig.add_subplot(111, projection='3d')
x=[]
y=[]
z=[]
with open('fcc_coordinates_a=1.500000_5rows_5columns_5layers.dat') as csv_file:
plots = csv.reader(csv_file, delimiter="\t")
for row in plots:
x.append(float(row[0]))
y.append(float(row[1]))
z.append(float(row[2]))
ax.scatter(x,y,z,c='r',marker='o')
ax.set_xlabel('x axis')
ax.set_ylabel('y axis')
ax.set_zlabel('z axis')
plt.show()
plt.xlim(0,7.5)
plt.ylim(0,7.5)
plt.zlim(0,7.5) Regards
