So in your case you’d replace plotly with matplotlib.
For a bit of back story, I was notified by JupyterLab a few weeks ago that it is recommended I run jupyter lab build. I ran this code but kept on running into the same error message: npm dependencies failed to install. I tried different methods I found through various forums but I could not figure it out. This time I tried using plotly.express in JupyterLab and the same error message popped up. Surfing through online community I found this GitHub page and found it quite useful.