-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Closed
Closed
Copy link
Description
Bug summary
When saving plots with plt.savefig() I get the following warning:
/usr/local/lib/python3.6/dist-packages/matplotlib/backends/backend_gtk3.py:197: Warning: Source ID 159 was not found when attempting to remove it
GLib.source_remove(self._idle_draw_id)
Code for reproduction
import matplotlib.pyplot as plt
x = [x/5 for x in range(1,101)]
y = [i for i in x]
plt.plot(x,y, label='line')
plt.xlabel('x')
plt.ylabel('y')
plt.legend()
plt.show()
plt.savefig('fig_test')
Actual outcome
the result of plt.show() works fine:
but the saved image looks like this, either empty or deformed if the plot is more complex:
Expected outcome
The saved figure should look like the one from plt.show()
Matplotlib version
Matplotlib was installed with the following commands:
sudo python3 -m pip install -U pip
sudo python3 -m pip install -U matplotlib