From: John H. <jdh...@ac...> - 2004-03-18 14:40:38
|
>>>>> "Jean-Baptiste" == Jean-Baptiste Cazier <Jea...@de...> writes: Jean-Baptiste> If I try to call figlegend from the canvas, Jean-Baptiste> canvas.Figure or canvas.Figure.axes[0], I get an Jean-Baptiste> erro message as figlegend is not defined in any of Jean-Baptiste> these contexts canvas.figure.figlegend(tuple([i[1] Jean-Baptiste> for i in d]),tuple([i[0] for i in d]),'upper Jean-Baptiste> center') AttributeError: Figure instance has no Jean-Baptiste> attribute 'figlegend' In order to trace what command you should be using to go from the matlab interface to the OO API, do the following Go to matlab.py and find the command you want to use. In this case it's figlegend. Search for 'def figlegend' You'll find: def figlegend(handles, labels, loc): 'snip documentation' l = gcf().legend(handles, labels, loc) draw_if_interactive() return l The critical line is l = gcf().legend(handles, labels, loc) gcf() returns the current Figure instance. Hence matlab.figlegend is calling Figure.legend. This should help, JDH |