Analogies are known to be powerful tools for making sense of unfamiliar ideas in terms of already understood concepts. Science students regularly encounter unfamiliar ideas, such as microscopic objects that are invisible to our everyday experience and behaviors dictated by quantum mechanics. An understanding of basic concepts of quantum mechanics is useful in many disciplines, especially with the growing field of quantum information sciences and technologies. Physics researchers often use analogies in their own research and science communicators use them to make quantum ideas accessible to K-12 students and across STEM disciplines, but analogy use in upper-division teaching has been less researched. Our research goal is to understand how analogies are used to teach quantum mechanics, and specifically, what prior knowledge is used as a basis for analogies within two widely used quantum mechanics textbooks. This textbook analysis shows the most common bases for analogies include: mathematical structures from linear algebra, which are applied to model quantum systems; everyday life examples, which are used to make quantum systems more familiar and understandable; and macroscopic classical phenomena, which are used to highlight differences between classical and quantum mechanics. We also find authors use different conventions, based on the various cue words that authors use to indicate analogy-based reasoning. In the STEM classroom, this research has implications for enhancing student learning about abstract topics in science.