Apparently Audacity uses dBFS so to get the exact same thing as Audacity, you would need to know what Audacity thinks the maximum peak value of amplitude is and then put that in place of np.max(your_spectrogram)
If I do a spectrogram and look at a time interval, I should be able to
get the same view however, getting the same scale seems to be a
challenge. Perhaps the solution is in what you provided but in this case
the np.max would be a static number?