PyQt: fill_between => Singular matrix #1063

Closed
senyai opened this Issue Aug 9, 2012 · 3 comments

Comments

Projects
None yet
2 participants

senyai commented Aug 9, 2012

Hi!
Run this code http://www.arseniy.net/files/capitalline_tab.py and click Report button two times. I see Singular matrix exception on 1.1.1. I think, that's because bbox is changed and I could not find where.
Thank you!

Contributor

pwuertz commented Aug 16, 2012

The exception disappears when you add self.canvas_frame to the CapitallineTab layout, instead of adding it to self.main_splitter.

Contributor

pwuertz commented Aug 16, 2012

Long story short, don't draw on a canvas that is not visible and has no height. Also don't forget to call the parent draw method when subclassing the canvas widget.

    def draw(self):
        #if not self.isVisible(): return

        x = [0, 1, 2, 3]
        y = [1, 2, 0, 4]
        try:
            self.axes.fill_between(x, 0, y, alpha=0.5)
            super(ReportCanvas, self).draw()
            print "draw: height %d" % self.size().height()
        except:
            e = "draw: error drawing on canvas, height %d, visible %s\n"
            sys.stderr.write(e % (self.size().height(), self.isVisible()))

Should there be an additional check in the Qt backend that prevents calling "draw" in such cases?

senyai commented May 29, 2013

Too specific to spend time for

senyai closed this May 29, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment