Hi Nico, If you're using IPython then you can do a cool trick. Say your your instantiation is called var. You can type:
var? and it'll spit out some info about the object, including what it's an instance of. If you type var?? it'll try to print out more detailed information. Hope that helps. Regards, -- Damon -------------------------- Damon McDougall Mathematics Institute University of Warwick Coventry CV4 7AL d.mcdoug...@warwick.ac.uk On 12 Jan 2010, at 10:40, Nico Schlömer wrote: > Hm. > > print type( gca() ) > print gca().__class__ > print isinstance( gca(), matplotlib.axes.AxesSubplots) > > yields > > <class 'matplotlib.axes.AxesSubplot'> > <class 'matplotlib.axes.AxesSubplot'> > Traceback (most recent call last): > File "./testfunctions.py", line 13, in <module> > print isinstance( a, matplotlib.axes.AxesSubplots) > AttributeError: 'module' object has no attribute 'AxesSubplots > > ?Nico > > > On Tue, Jan 12, 2010 at 6:45 AM, Joshua J. Kugler <jos...@eeinternet.com> > wrote: >> On Monday 11 January 2010, Nico Schlömer elucidated thus: >>> quick question from a Python noob: >>> Suppose I have an instance of an object of matplotlib, Is there any >>> way to check on its type, e.g., whether it is an instance of >>> matplotlib.axes.AxesSubplots? >> >> Python's built-in 'isintance.' >> >> isinstance(var, matplotlib.axes.AxesSubplots) >> >> j >> >> -- >> Joshua Kugler >> Part-Time System Admin/Programmer >> http://www.eeinternet.com >> PGP Key: http://pgp.mit.edu/ ID 0x14EA086E >> > > ------------------------------------------------------------------------------ > This SF.Net email is sponsored by the Verizon Developer Community > Take advantage of Verizon's best-in-class app development support > A streamlined, 14 day to market process makes app distribution fast and easy > Join now and get one step closer to millions of Verizon customers > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/matplotlib-users ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users