This essay argues that the material culture of the Renaissance garden played an important role in the development of Cartesian mathematical and mechanical philosophy. Garden machinery such as Salomon and Isaac de Caus's automata and grottoes provided a model from which Descartes drew his clockwork conceptions of nature and the human body. This machinery was also crucial in the Cartesian explanation of the rainbow. Not simply an exercise in intellectual curiosity, Descartes's geometrical description of the rainbow in Discourse Eight of the Météores was a direct response to the engineers of artificial rainbow fountains which populated European princely gardens for much of the sixteenth and early seventeenth centuries. Rejecting distinctions between ‘natural’ and ‘artificial’ rainbows, Descartes used these fountains and his own constructions of artificial water drops to discern the causes of the rainbow by refraction and reflection and, by analogy, to suppose this the explanation of rainbows in the sky. This knowledge was then utilized to propose an alternative to the rainbow fountain, using refracting liquids to cast images in the sky. Descartes presented a ‘science of miracles’ destined not to eradicate wonder but to make transparent the wonders of traditional garden engineers and replace them with wonders derived from knowledge of mathematical and mechanical philosophy. As such, the ‘science of miracles’ gave a new emphasis to the mind of the natural philosopher as the essential component in the creation of wonders, rather than the traditional skills and experience of the artisan or engineer.