matplotlib imshow editing x-axis
问题 I want to display an amplitude spectrum of an image. I am able to do this using following code: import numpy as np import matplotlib.pyplot as plt import pylab pylab.gray() pic = pylab.imread("C:/pic.png")[::-1,:] amp_pic = pylab.subplot(1,4,1) amp_pic.xaxis.set_ticks_position('top') pylab.imshow(np.abs(np.fft.fftshift(np.fft.fft2(pic))),\ interpolation='nearest') pylab.show() But the axis is not labeled the way an amplitude spectrum should be labeled. In the case of a 1D-function the