From: mike c. <mc...@st...> - 2006-02-01 20:22:34
|
Hi, I embed a matplotlib canvas in a wxPython dialog. This works great and the title of the figure is displayed as the window title for the dialog, which is dandy. Here is a stripped down version of the code (minus navigation toolbar etc) class PlotDialog(wx.Dialog): def __init__( self, parent, ID, title, MakeFigArgs, size=wx.DefaultSize, pos=wx.DefaultPosition, style=wx.DEFAULT_DIALOG_STYLE): # Precreation code pre = wx.PreDialog() pre.SetExtraStyle(wx.DIALOG_EX_CONTEXTHELP) pre.Create(parent, ID, title, pos, size, style) self.PostCreate(pre) self.canvas = FigureCanvas(self, -1, self.figure) self.figure = Figure(figsize=(5,4), dpi=100) self.axes = self.figure.add_subplot(111) self.axes.plot([1,2,3], [1,2,3] However, I also want the title to appear in the plot itself, so that when I issue: self.canvas.Copy_to_Clipboard(event=evt). I have a title with my plot. Simply adding title("The Title") Does nothing. Any tips? Thanks -mike |