标签: python matplotlib
我有变量N和W随每次运行而变化。是否可以执行以下操作?:
pylab.title('Minimal Energy Configuration of' N 'Charges on Disc' 'W = 'W)
答案 0 :(得分:20)
我认为你在谈论字符串插值如下:
pylab.title('Minimal Energy Configuration of %s Charges on Disc W = %s'%(N, W))