These UV–vis–NIR spectra were obtained from doped PBTTT thin films before and after annealing at the indicated temperatures. a, An F4TCNQ-doped PBTTT thin film. b–i, Anion-exchange-doped films with: b, K2CO3; c, BMIM-FAP; d, BMIM-FeCl4; e, BMIM-BF4; f, BMIM-PF6; g, BMIM-TFSI; h, Li-PFSI; and i, Li-BOB. j, Ratios of conductivity before and after annealing at 120 °C and 160 °C. Details of doping conditions are provided in the Supplementary Information.