刚安装了matplotlib,试了下下面几行代码,但不能画图,请问该怎么解决呢?
>>> import matplotlib.pyplot as plt
>>> plt.bar(left = (0,1),height = (1,0.5))
<Container object of 2 artists>
>>> plt.show()
(.:14956): GLib-GIO-CRITICAL **: g_dbus_connection_register_object: assertion 'G_IS_DBUS_CONNECTION (connection)' failed
(.:14956): GLib-GIO-CRITICAL **: g_dbus_connection_register_object: assertion 'G_IS_DBUS_CONNECTION (connection)' failed
(.:14956): GLib-GIO-CRITICAL **: g_dbus_connection_get_unique_name: assertion 'G_IS_DBUS_CONNECTION (connection)' failed
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_gtk3.py", line 339, in idle_draw
self.draw()
File "/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_gtk3.py", line 332, in draw
self.get_property("window").process_updates (False)
TypeError: Couldn't find foreign struct converter for 'cairo.Context'