我想你要
subplots_adjust:
fig,ax = plt.subplots(1)fig.subplots_adjust(left=0,right=1,bottom=0,top=1)ax.axis('tight')ax.axis('off')
在这种情况下:
import matplotlib.pyplot as pltfrom scipy.io import wavfileimport numpy as npdef graph_spectrogram(wav_file): rate, data = wavfile.read(wav_file) fig,ax = plt.subplots(1) fig.subplots_adjust(left=0,right=1,bottom=0,top=1) ax.axis('off') pxx, freqs, bins, im = ax.specgram(x=data, Fs=rate, noverlap=384, NFFT=512) ax.axis('off') fig.savefig('sp_xyz.png', dpi=300, frameon='false')if __name__ == '__main__': # Main function graph_spectrogram('...')
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)