该文件是1000乘1000,我想打印所有的x值,但只有我的数据第500行。到目前为止,我的代码是:
import matplotlib.pyplot as plt
from numpy import *
from pylab import *
import scipy.ndimage
from scipy import *
data = fromfile("m33.dat",dtype=int16)
data_fortran=data.reshape((1000,1000),order="FORTRAN")
data2 = scipy.ndimage.filters.gaussian_filter(data_fortran,5,mode="nearest")
#plot m33.dat into a contour plot
plt.imshow(data2,interpolation="none",cmap="binary")
plt.show()
由于Python使用基于0的索引,第500行的索引值为499。你知道吗
相关问题 更多 >
编程相关推荐