Ask Your Question

RB's profile - activity

2015-12-20 17:22:10 +0200 received badge  Popular Question (source)
2014-01-12 20:59:54 +0200 received badge  Editor (source)
2014-01-12 19:54:00 +0200 asked a question Unable to get Show() with GTK backend inside Sage

I am trying to do the following with GTK as the sage backend.

import matplotlib.pyplot as plt

plt.plot([1,2,3])
plt.ylabel('Numbers')
plt.show()

I am able to do this inside Python with the following:

import matplotlib
matplotlib.use('GTK')
import matplotlib.pyplot as plt
plt.plot([1,2,3])
plt.ylabel('Numbers')
plt.show()

This fails in sage which asked me to install pygtk. When I did

sage: install_package('pygtk'), 

it pulled an experimental pygtk-2.8.4 which failed with the following error

checking for gcc... gcc
checking for C compiler default output file name... configure: error: C compiler cannot create executables
See `config.log' for more details.
ERROR configuring pygtk for build!

I do have gcc/g++ installed in /usr/bin and in /usr/local/bin/sage/local/bin

All other backends like WX or PyQt4 run into other issues. I suspect this is a problem with the pygtk spkg. If someone has a workaround for this, please send/propose it.