From: John H. <jdh...@ac...> - 2004-04-16 16:51:17
|
>>>>> "Flavio" == Flavio Codeco Coelho <fcc...@fi...> writes: Flavio> Jeremy, how can I set axes limits on a figure embedded in Flavio> WX? I am plotting with Flavio> a = self.figmgr.add_subplot(111) a.plot(x,y) Flavio> just like in your example. Flavio> I would like to do someting like: Flavio> axis([0,10,0,10]) There is no axis command in the OO interface (though is would be easy to add..). You can always go to matlab.py and see how it is interacting with the gca instance. If you use your 'a' instance everywhere it uses gca(), you can duplicate it's functionality. Flavio> set(gca(),'xticklabels',[]) set(gca(),'yticklabels',[]) Flavio> set(gca(),'xticks',[]) set(gca(),'yticks',[]) the syntax of set is set(object or sequence, somestring, attribute) if called with an object, set calls object.set_somestring(attribute) if called with a sequence, set does for object in sequence: object.set_somestring(attribute) So for your example, gca() is an object, so a.set_xticklabels([]) a.set_yticklabels([]) a.set_xticks([]) a.set_yticks([]) You may want to take another look at the tutorial section "Controlling axes properties" which gives examples of both the matlab and OO methods To replicate axis, do a.set_xlim((xmin, xmax)) a.set_ylim((ymin, ymax)) Should help! JDH |