wxPyPlot on Linux Problem

Hi All,

I have had a couple of messages like this for wxPyPlot on Linux. I don't
have a Linux box to test it on, but it works well under Windows so I am
assuming that there is a problem with wxPython or wxWindows.

Maybe this is an isolated problem with their configuration or distribution.
If it is working for you please respond.

Can anyone shed some light on this?

Thanks,

Gordon Williams

Hello Gordon!

Before I say anything I would like to congratulate this great work!

I've downloaded the wxPyPlot.zip from cyberus and tested on
Mandrake 8.2 Linux
Python 2.2.1 (from rpm)
wxPython 2.4.0.6 (from rpm)

(libgtk+1.2-devel-1.2.10-25mdk, libgtk+2-1.3.13-2mdk, wxGTK-2.3.2-1,

wxGTK-devel-2.3.2-1)

When I run the application in standalone mode( with example drawings )
and click on the Draw1 I see no point on the canvas only the x-axis and
y-axis with measure points. (No error message.)
When I click on Draw2 I get the following error:

wxPython.wxc.wxPyAssertionError: C++ assertion "wxAssertFailure" failed
in /usr/src/redhat/BUILD/wxPythonSrc-2.4.0.6/src/common/image.cpp(724):
invalid image
[Debug] 09.52.44: C++ assertion "wxAssertFailure" failed in
/usr/src/redhat/BUILD/wxPythonSrc-2.4.0.6/src/gtk/bitmap.cpp(281):
invalid bitmap size
[Debug] 09.52.44: C++ assertion "wxAssertFailure" failed in
/usr/src/redhat/BUILD/wxPythonSrc-2.4.0.6/src/gtk/dcclient.cpp(1982):
invalid window dc
[Debug] 09.52.44: C++ assertion "wxAssertFailure" failed in
/usr/src/redhat/BUILD/wxPythonSrc-2.4.0.6/src/gtk/dcclient.cpp(1934):
invalid window dc
[Debug] 09.52.44: C++ assertion "wxAssertFailure" failed in
/usr/src/redhat/BUILD/wxPythonSrc-2.4.0.6/src/gtk/dcclient.cpp(1727):
invalid window dc
[Debug] 09.52.44: C++ assertion "wxAssertFailure" failed in
/usr/src/redhat/BUILD/wxPythonSrc-2.4.0.6/src/gtk/dcclient.cpp(1417):
invalid window dc
[Debug] 09.52.44: C++ assertion "wxAssertFailure" failed in
/usr/src/redhat/BUILD/wxPythonSrc-2.4.0.6/src/gtk/bitmap.cpp(682):
invalid bitmap
[Debug] 09.52.44: C++ assertion "wxAssertFailure" failed in
/usr/src/redhat/BUILD/wxPythonSrc-2.4.0.6/src/common/image.cpp(724):
invalid image
Traceback (most recent call last):
  File "wxPyPlot.py", line 726, in OnPaint
      self.Draw(graphics,xSpec,ySpec,dc)
  File "wxPyPlot.py", line 659, in Draw

dc.DrawRotatedText(graphics.getYLabel(),yLabelPos[0],yLabelPos[1],90)

  File "/usr/lib/python2.2/site-packages/wxPython/gdi.py",
  line 564, in DrawRotatedText
      val = apply(gdic.wxDC_DrawRotatedText,(self,) + _args,_kwargs)
  wxPython.wxc.wxPyAssertionError: C++ assertion "wxAssertFailure" failed

in /usr/src/redhat/BUILD/wxPythonSrc-2.4.0.6/src/common/image.cpp(724):
invalid image

···

----- Original Message -----
Sent: Friday, March 28, 2003 3:55 AM
Subject: wxPyPlot on Linux

When I've more time I install Mandrake 9.1 and test it again. I think my
system has some failure on packages because I use it as an intensive
development platform. :slight_smile:

wxPython.wxc.wxPyAssertionError: C++ assertion "wxAssertFailure"
failed in
/usr/src/redhat/BUILD/wxPythonSrc-2.4.0.6/src/common/image.cpp(724):
invalid image [Debug] 09.52.44: C++ assertion "wxAssertFailure"
failed in /usr/src/redhat/BUILD/wxPythonSrc-2.4.0.6/src/gtk/bitmap.cpp(281): invalid bitmap size [Debug] 09.52.44: C++ assertion
"wxAssertFailure" failed in /usr/src/redhat/BUILD/wxPythonSrc-2.4.0.6/src/gtk/dcclient.cpp(1982):
invalid window dc [Debug] 09.52.44: C++ assertion
"wxAssertFailure" failed in /usr/src/redhat/BUILD/wxPythonSrc-2.4.0.6/src/gtk/dcclient.cpp(1934):
invalid window dc [Debug] 09.52.44: C++ assertion
"wxAssertFailure" failed in /usr/src/redhat/BUILD/wxPythonSrc-2.4.0.6/src/gtk/dcclient.cpp(1727):
invalid window dc [Debug] 09.52.44: C++ assertion
"wxAssertFailure" failed in /usr/src/redhat/BUILD/wxPythonSrc-2.4.0.6/src/gtk/dcclient.cpp(1417):
invalid window dc [Debug] 09.52.44: C++ assertion
"wxAssertFailure" failed in /usr/src/redhat/BUILD/wxPythonSrc-2.4.0.6/src/gtk/bitmap.cpp(682): invalid bitmap [Debug] 09.52.44: C++ assertion "wxAssertFailure"
failed in /usr/src/redhat/BUILD/wxPythonSrc-2.4.0.6/src/common/image.cpp(724):
invalid image Traceback (most recent call last): File
"wxPyPlot.py", line 726, in OnPaint self.Draw(graphics,xSpec,ySpec,dc) File "wxPyPlot.py", line 659, in
Draw

dc.DrawRotatedText(graphics.getYLabel(),yLabelPos[0],yLabelPos[1],90)

File "/usr/lib/python2.2/site-packages/wxPython/gdi.py", line 564,
in DrawRotatedText val = apply(gdic.wxDC_DrawRotatedText,(self,) +
_args,_kwargs) wxPython.wxc.wxPyAssertionError: C++ assertion
"wxAssertFailure" failed

in
/usr/src/redhat/BUILD/wxPythonSrc-2.4.0.6/src/common/image.cpp(724): invalid image

Apparently the wxGTK version of DrawRotatedText has problems if the
string is empty. You should check that that the string is not empty
before attempting to draw it

     if graphics.getYLabel():
      dc.DrawRotatedText(graphics.getYLabel(), yLabelPos[0],
                         yLabelPos[1], 90)

You should also change _getFont to look like this to work around the font resize bug that was mentioned here recently:

     def _getFont(self,size):
         """Take font size, adjusts if printing and returns wxFont"""
         s= size*self.printerScale
         font= self.GetFont()
         return wx.wxFont(s, font.GetFamily(), font.GetStyle(),
                          font.GetWeight(), font.GetUnderlined(),
                          font.GetFaceName(), font.GetEncoding())

I don't know why the plot points/lines are not showing up. It looks like they are being drawn, but are smushed down to the lower axis of the plot and are then being drawn over by the axis...

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!