The easiest solution is the "title" keyword for subplot:

pylab.subplot(221, title='A Title for 221')

I'm using matplotlib/pylab 0.98.3

-- NTroutman


Tommy Grav wrote:
> 
> I have a plot that is divided into four subplots.
> 
> pylab.figure()
> pylab.subplot(221)
> pylab.plot(a,b,"k-")
> pylab.subplot(222)
> pylab.plot(a,b,"k-")
> pylab.subplot(223)
> pylab.plot(a,b,"k-")
> pylab.subplot(224)
> pylab.plot(a,b,"k-")
> 
> I would like to add a title to the entire plot, but pylab.title() only
> applies to the most recent subplot. I have tried
> 
> pylab.figure()
> pylab.subplot(111)
> pylab.title("Title Here")
> pylab.subplot(221)
> pylab.plot(a,b,"k-")
> pylab.subplot(222)
> pylab.plot(a,b,"k-")
> pylab.subplot(223)
> pylab.plot(a,b,"k-")
> pylab.subplot(224)
> pylab.plot(a,b,"k-")
> 
> but this does not work as I do not create a plot for
> the subplot(111) instance. Is there some way of getting
> the type of title I want easily?
> 
> Cheers
>    Tommy
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 

-- 
View this message in context: 
http://www.nabble.com/title-when-using-subplot-tp15066004p22605721.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to