You can see I am using ax.plot
but nothing happened.
Asked
Active
Viewed 30 times
0
-
you have to call `plt.show()` – Jody Klymak Aug 13 '22 at 01:24
-
1Does this answer your question? [matplotlib plot window won't appear](https://stackoverflow.com/questions/13151514/matplotlib-plot-window-wont-appear) – Jody Klymak Aug 13 '22 at 01:25
1 Answers
0
Just call plt.show()
when you've run all of your graph creation code:
import numpy as np
import matplotlib.pyplot as plt
x= np.arange(-10, 10, 0.1)
fig, ax = plt.subplots()
ax.plot(x, np.cos(x))
plt.show()

Michael S.
- 3,050
- 4
- 19
- 34