1# Assign variable to librosa.display.specshow() as example below:
2p =librosa.display.specshow(librosa.amplitude_to_db(Y,ref=np.max), y_axis='linear', x_axis='time', sr=fs, hop_length=H, cmap=cmap)
3p.xaxis.zoom(3) #the zoom-in with +number or out with -number on x-axis
4# similarly the y-axis can be zoomed-in as:
5p.yaxis.zoom(3)
6