An historical example of an analogy used to explain science:
William Gilbert
"Rightly then in some measure does Aristotle make out the matter of metals to be that exhalation which in continuance thickens in the lodes of certain soils: for the vapours are condensed in places which are less hot than the spot whence they issued, and by help of the nature of the soils and mountains, as in a womb, they are at fitting seasons congealed and changed into metals: but it is not they alone which make ores, but they flow into and enter a more solid material, and so make metals. So when this concreted matter has settled down in more temperate beds, it begins to take shape in those tepid places, just as seed in the warm womb, or as the embryo acquires growth…"
Gilbert, W. (1600). On the Magnet, Magnetick Bodies also, and on the great magnet of the earth; a new physiology, demonstrated by many arguments & experiments.
The reference 'as in a womb' would by itself be seen as a simile, but Gilbert then develops the analogy further. It is more than an extended metaphor as the mapping {from analogue to target:ground to womb; metal/ore to embryo} is made explicit.
This notion of the formation of ores is now seen as an alternative conception.
Read examples of scientific analogies