A historical examples of an analogy used by a scientist:
"…a comparison of the old atomists, employed by Lucretius and others to illustrate the production of an infinite number of bodies from such simple fragments of matter as they thought their atoms to be. For since of the 24 letters of the [Greek] alphabet, associated several ways as to the number and placing of the letters, all the words of the several languages in the world may be made, so, say these naturalists, by variously connecting such and such numbers of atoms, of such shapes, sizes, and motions, into masses or concretions, an innumerable multitude of different bodies may be formed…"
Robert Boyle
Quoted in: Marina Paola Banchetti-Robino (2020) The Chemical Philosophy of Robert Boyle. Mechanicism, Chymical Atoms, and Emergence