Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am currently trying to build a simple app that includes some pylab figures. I just started to use quickly and I am concerned about some import issues. That is, none of the matplotlib backends will be able to work.

More specifically, if any of the following import statements is uncommented in my main file, then quickly will fail to run the app

#from matplotlib.backends.backend_gtk import FigureCanvasGTK as FigureCanvas
#from matplotlib.backends.backend_gtkagg import FigureCanvasGTKAgg as FigureCanvas
#from matplotlib.backends.backend_gtkcairo import FigureCanvasGTKCairo as FigureCanvas

so there is no way I can embed a plot.

Here is the output of quickly run if the backend_gtk is uncommented

/usr/lib/python2.7/dist-packages/gobject/ Warning: g_boxed_type_register_static: assertion `g_type_from_name (name) == 0' failed   import gobject._gobject 
/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/ Warning: specified class size for type `PyGtkGenericCellRenderer' is smaller than the parent type's `GtkCellRenderer' class size   from gtk import
/usr/lib/python2.7/dist-packages/gtk-2.0/gtk/ Warning: g_type_get_qdata: assertion `node != NULL' failed   from gtk import _gtk

Any idea of what could solve the problem? Do you need more information?

share|improve this question
Question closed during answering... Anyway: you'll need atleast version 1.2.0 of matplotlab, which can be installed by pip if it's not in your repository. Then use the GTK3 backends, for example: – Timo Mar 1 '14 at 11:08
Thanks for your answer Timo. – Buddyshot Mar 1 '14 at 16:10
Developing GUI apps in Python that run on Ubuntu is widely treated as on-topic on Ask Ubuntu, though I'm not aware of any strong community consensus either way on the issue. This question certainly seems on-topic since it's about Quickly, though the answer is not Quickly-specific. This is answered in a comment and that comment would better be posted as an answer. I've voted to reopen this, though I understand if some people disagree. – Eliah Kagan Mar 2 '14 at 18:37
@Timo The question is now reopened. Can you add an answer? – Seth Mar 2 '14 at 19:32
up vote 1 down vote accepted

You'll need atleast version 1.2.0 of matplotlib and then use the GTK3 backends.

Example taken from

#!/usr/bin/env python
demonstrate adding a FigureCanvasGTK3Agg widget to a Gtk.ScrolledWindow
using GTK3 accessed via pygobject

from gi.repository import Gtk

from matplotlib.figure import Figure
from numpy import arange, sin, pi
from matplotlib.backends.backend_gtk3agg import FigureCanvasGTK3Agg as FigureCanvas

win = Gtk.Window()
win.connect("delete-event", Gtk.main_quit )
win.set_title("Embedding in GTK")

f = Figure(figsize=(5,4), dpi=100)
a = f.add_subplot(111)
t = arange(0.0,3.0,0.01)
s = sin(2*pi*t)

sw = Gtk.ScrolledWindow()
win.add (sw)
# A scrolled window border goes outside the scrollbars and viewport
sw.set_border_width (10)

canvas = FigureCanvas(f)  # a Gtk.DrawingArea
sw.add_with_viewport (canvas)


Note: Ubuntu 12.04 doesn't have Matplotlib 1.2.0 in the repository, but it is installable through pip:

sudo pip install matplotlib
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.