Extracting the data
From this answer to get the amplitude data from an mp3 audio files using python, use pydub
:
from pydub import AudioSegment
sound = AudioSegment.from_mp3("test.mp3")
# get raw audio data as a bytestring
raw_data = sound.raw_data
# get the frame rate
sample_rate = sound.frame_rate
# get amount of bytes contained in one sample
sample_size = sound.sample_width
# get channels
channels = sound.channels
Plotting the data
Look at Matplotlib for plotting data in Python. It's very comprehensive (almost dauntingly so).
However, there are loads of tutorials and examples out there. I used this (amongst other things) to learn it: Python Plotting With Matplotlib (Guide).
You can probably skim and skip the super-funky examples and just get a basic X-Y plot displayed pretty quickly.
StackOverflow also has a number of simple examples provided in the answers.
Putting them together - an example
From this answer to Plot spectogram from mp3:
from pydub import AudioSegment
import matplotlib.pyplot as plt
from scipy.io import wavfile
from tempfile import mktemp
mp3_audio = AudioSegment.from_file('speech.mp3', format="mp3") # read mp3
wname = mktemp('.wav') # use temporary file
mp3_audio.export(wname, format="wav") # convert to wav
FS, data = wavfile.read(wname) # read wav file
plt.specgram(data, Fs=FS, NFFT=128, noverlap=0) # plot
plt.show()