I'm building plots in stages using several different functions. Since
the figure contains all information, I don't hand handles to
individual elements around.

What's the best way to check for a specific plot element? using
isinstance, or are there specific attributes that could be checked?



For example, I want to add a colorbar to the figure corresponding to
the first axis.imshow:

>>> images = [c for ax in f.axes for c in ax.get_children() if isinstance(c, 
>>> mpl.image.AxesImage)]
>>> images
[<matplotlib.image.AxesImage object at 0x08C0CAD0>]
>>> f.colorbar(images[0])
<matplotlib.colorbar.Colorbar instance at 0x08E033F0>
>>> f
<matplotlib.figure.Figure object at 0x08B614D0>

example
using recipe 
http://matplotlib.sourceforge.net/examples/pylab_examples/subplots_adjust.html
https://lh5.googleusercontent.com/-rpw4NHbXvxM/TpmnumYNcRI/AAAAAAAAAK0/5zLnnUPjg0A/corrmatrixgrid.png

Thanks,

Josef

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to