I am using Microsoft Windows Subsystem for Linux (WSL), Ubuntu 18.04 and Python 3.6.7. When I execute this file from the command line, it does not display the plot. What is wrong?
# hello.py
import numpy as np
import matplotlib.pyplot as plt
t = np.linspace(0,np.pi,101)
x = np.sin(t)
fig,ax=plt.subplots(figsize=(9,3))
ax.plot(t,x)
ax.grid()
plt.tight_layout()
plt.show()
This code when executed from an Ubuntu terminal should display this plot, but it doesn't display it in WSL.