def get_psd(self, data, NFFT, FS):
        try:
            Pxx, freqs = self.axes.psd(data, NFFT = NFFT, Fs = FS)
            self.need_refresh = True
        except RuntimeError as err_re:
            print("Warning:", err_re)
            Pxx, freqs = None, None
        return Pxx, freqs
By calling 'psd' within axes, it both calculates and plots the spectrum
dataset/ETHPy150Open ericgibert/supersid/supersid/tksidviewer.py/tkSidViewer.get_psd