We present a new class of exact interior solutions for anisotropic spheres to the Einstein field equations with a prescribed energy density. This category of solutions has similar energy density profiles to the models of Chaisi and Maharaj (Gen. Rel. Grav. 37, 1177-1189, 2005) whose approach we follow in the integration process. A distinguishing feature of the solutions presented is that they satisfy a barotropic equation of state linearly relating the radial pressure to the energy density.