Reputation: 466
I am trying to plot a graph using the following code:
import numpy as np
import matplotlib.pyplot as plt
arr = np.random.randint(1,50,10)
print(arr)
y, x = np.histogram(arr,bins=np.arange(51))
fig, ax = plt.subplots()
ax.plot(x[:-1],y)
fig.show()
The error displayed is:
<ipython-input-4-31fe4acba862>:8: UserWarning: Matplotlib is currently using module://ipykernel.pylab.backend_inline, which is a non-GUI backend, so cannot show the figure.
Upvotes: 1
Views: 860
Reputation: 41327
The warning comes from fig.show()
. You can remove this when using jupyter.
Upvotes: 2