ok here comes some more code:

def plot_angles(results, axes):
    lk.acquire()
    x = list(results[0])
    y = list(results[1])
    lk.release()
    p = axes.scatter(x,y, c = range(len(results[0])))
    axes.set_xlabel('psi')
    axes.set_ylabel('delta')
    colorbar(p)

def update_figure(self):
    plot_angles(results, self.axes)
    self.draw()


_tkinter.TclError: bad screen distance "320.0"
Traceback (most recent call last):
  File "/home/sonium/UbuntuOne/elipsometry/fitting.py", line 156, in
update_figure
    plot_angles(results, self.axes)
  File "/home/sonium/UbuntuOne/elipsometry/fitting.py", line 173, in
plot_angles
    colorbar(p)
  File "/usr/lib/pymodules/python2.6/matplotlib/pyplot.py", line 1367, in
colorbar
    ax = gca()
  File "/usr/lib/pymodules/python2.6/matplotlib/pyplot.py", line 582, in gca
    ax =  gcf().gca(**kwargs)
  File "/usr/lib/pymodules/python2.6/matplotlib/pyplot.py", line 276, in gcf
    return figure()
  File "/usr/lib/pymodules/python2.6/matplotlib/pyplot.py", line 254, in
figure
    **kwargs)
  File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_tkagg.py",
line 91, in new_figure_manager
    canvas = FigureCanvasTkAgg(figure, master=window)
  File "/usr/lib/pymodules/python2.6/matplotlib/backends/backend_tkagg.py",
line 159, in __init__
    self._tkcanvas.create_image(w/2, h/2, image=self._tkphoto)
  File "/usr/lib/python2.6/lib-tk/Tkinter.py", line 2159, in create_image
    return self._create('image', args, kw)
  File "/usr/lib/python2.6/lib-tk/Tkinter.py", line 2150, in _create
    *(args + self._options(cnf, kw))))
_tkinter.TclError: bad screen distance "320.0"


On Sun, Jan 3, 2010 at 1:07 PM, John Hunter <jdh2...@gmail.com> wrote:

> On Sun, Jan 3, 2010 at 11:34 AM, Alexander Hupfer <son...@gmail.com>
> wrote:
> > Hi, I have a scatter plot embedded in qt4 according to
> >
> http://matplotlib.sourceforge.net/examples/user_interfaces/embedding_in_qt4.html
> > what works fine
> > However if I try to add a colorbar to it by simply calling
> >
> > p = scatter(....)
> > colorbar(p)
> >
> > I get an error that says that something is outside the drawable area.
>
> Please post example code which replicates the problem and a full
> traceback.  From the snippet you posted, it looks like you may be
> using the pylab/pyplot interface which is not consistent with
> embedding mpl in qt or any other widget set.  Rather, you need to be
> using the mpl API.
>
> JDH
>
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to