From: Jim B. <jb...@se...> - 2004-05-12 05:06:47
|
Hi, This evening i played a bit with trying to add a legend to a plot widget that i have. Here is the relevant test code snippet (based on the example: embedding_in_wx.py) class PlotFigure(wxFrame): def plotMultiYData(self, xList, yLists, xRangeList, yRangeList): a = self.figmgr.add_subplot(111) x = self.__listToFloatArray(xList) for yList in yLists: y = self.__listToFloatArray(yList) a.plot(x,y, marker='o', markersize=4.0) a.legend(('aLabel'), 'upper center') a.set_xlim(xRangeList) a.set_ylim(yRangeList) # End of: for yList in yLists: self.toolbar.update() The aLabel gets printed like: a L a b e l and the first plot associates with the first 'a' the second with the 'L' etc. Clearly at the moment i'm only trying to apply a legend to the first plot. Once i get that sorted out i would expect ('legend1', legend2') to work for 2 plots etc. Anyone want to give me a hint as to what i'm doing wrong here? I would really like to specify that the legend appear off of the plot...say to the left of the y axis tick marks...any hints here? Thanks, Jim |