Python: Using variables in Pylab Titles

matplotlibpython

I have variables N and W which change with each run. Is it possible to do something like the following?:

pylab.title('Minimal Energy Configuration of' N 'Charges on Disc' 'W = 'W)

Best Solution

I think your talking about string interpolation like this :

pylab.title('Minimal Energy Configuration of %s Charges on Disc W = %s'%(N, W))