How do you plot an SPL vs frequency curve for a given set of pressure data?
The steps will be, in this order:


apply window function (e.g. Hann or Hamming)
calculate FFT
calculate magnitude of FFT (sqrt(re*re+im*im))
convert magnitude to dB (20*log10(magnitude))
apply combined correction/calibration factors (window function compensation, FFT factor of N scaling if needed, factor of 2 for symmetric FFT, Pref calibration, etc) - this can just be a single dB correction value that you add to the dB magnitude values


If your Pref calibration data varies with frequency (e.g. microphone with non-flat frequency response) then it's a little more complicated than the above, but the same basic principles apply.

Note also that if you want weighted dB SPL (e.g. A weighting) then you'll also need to apply the relevant frequency dependent weighting corrections.