python - I have a galaxy image and I only want to plot the 500th row -
the file 1000 1000 , want plot x values 500th row of data. code far is:
import matplotlib.pyplot plt numpy import * pylab import * import scipy.ndimage 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 contour plot plt.imshow(data2,interpolation="none",cmap="binary") plt.show()
plt.imshow(data2[499].reshape(1,-1),interpolation="none",cmap="binary") since python uses 0-based indexing, 500th row found @ index value 499.
Comments
Post a Comment