I initiated the VS Code window through a WSL Ubuntu terminal such as
/mnt/d/github/python/python_for_data_science$ code .
And test a plot
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(0, 5, 11)
y = x**2
# functional
plt.plot(x, y)
plt.show()
By Run Python File in Terminal, it shows
/mnt/d/github/python/python_for_data_science$ /usr/bin/python /mnt/d/github/python/python_for_data_science/section_8_matplotlib.py
But I didn't see a plot. Have I missed something?
WSL might not have the ability to show UI. Alternatively you can run the code in the Python Interactive window in order to see the output. Try right-click and select Run Current File in Python Interactive window.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With