Can Matplotlib Produce a Frequency Spectrum?

Hello house, please can Matplotlib be used to distribute an electromagnetic wave into frequencies, plotting amplitude (or intensity) on the vertical axis and frequency on the horizontal axis?
If yes, please can someone help me with a sample python code that can do that?
Thank you.

You are looking for scipy.signal.psd and loglog Matplotlib also has a psd but we’d prefer not to.

Thanks for your reply. But please can you implement it in a sample code so I can learn how it is being applied? I will be grateful. Thank you.

There are examples in the docs of those functions and lots of examples on stackoverflow.

Okay, thanks. I will check. Thank you.