It has been recently conjectured that the spectral determinants of operators associated to mirror curves can be expressed in terms of a generalization of theta functions, called quantum theta functions. In this paper we study the symplectic properties of these spectral determinants by expanding them around the point , where the quantum theta functions become conventional theta functions. We find that they are modular invariant, order by order, and we give explicit expressions for the very first terms of the expansion. Our derivation requires a detailed understanding of the modular properties of topological string free energies in the Nekrasov–Shatashvili limit. We derive these properties in a diagrammatic form. Finally, we use our results to provide a new test of the duality between topological strings and spectral theory.