For those that are interested, this is what I came up with to
get rid of the Deprecation Warnings in wxPyPlot after following
Robin's advice. I truncate here. You may wish to round.
Regards,
Gordon Williams
# Hack to allow plotting real numbers for the methods listed.
# All others passed directly to DC using getattr.
# For Drawing it is used as
# dc = FloatDCWrapper(wx.wxBufferedDC(wx.wxClientDC(self), self._Buffer))
# For printing is is used as
# dc = FloatDCWrapper(self.GetDC())
class FloatDCWrapper:
def __init__(self, aDC):
self.theDC = aDC
def DrawLine(self, x1,y1,x2,y2):
self.theDC.DrawLine(int(x1),int(y1),int(x2),int(y2))
def DrawText(self, txt, x, y):
self.theDC.DrawText(txt, int(x), int(y))
def DrawRotatedText(self, txt, x, y, angle):
self.theDC.DrawRotatedText(txt, int(x), int(y), angle)
def SetClippingRegion(self, x, y, width, height):
self.theDC.SetClippingRegion(int(x), int(y), int(width),
int(height))
def SetDeviceOrigin(self, x, y):
self.theDC.SetDeviceOrigin(int(x), int(y))
def __getattr__(self, name):
return getattr(self.theDC, name)