Even to scientists, the question of where great discoveries come from is a bit of a mystery. Young biologists learn technique. They learn to sequence DNA, extract sediment cores or distinguish chemical compounds. But how to make a big breakthrough, well, that is equal parts chance and voodoo. Scientists who have a great insight one day (and implicitly, at least in that moment, understand discovery) are as likely to fade into anonymity the next as to make more big discoveries.

Among the classic examples of the unpredictable nature of discovery is that of the Scottish son of a pig farmer, Alexander Fleming. As you may have learned in school, Fleming kept a messy lab. He left petri dishes, microbes and nearly everything else higgledy-piggledy on his lab benches, untended. One day in September of 1928, Fleming returned from a trip and found a goop of some sort growing into a stack of abandoned bacterial cultures and killing them. The circle of goop was a fungus. In that chance moment, Fleming discovered the antibiotic properties of penicillin, properties that would change the world.

Because of Fleming and the scientists who elaborated on his discovery, millions of lives were saved. Some of you are alive to read this because of Fleming. Even if you were not saved by penicillin or some other antibiotic yourself, one of your ancestors likely was. That much about Fleming’s legacy is true. He was an ordinary man who had an extraordinary impact. What is wrong is the idea that his discoveries were simply happenstance. There is more to the story.

In addition to working as a scientist, and well before his discovery of antibiotics, Fleming painted. He was a member of the Chelsea Arts Club, where he created amateurish watercolors. Less well known is that he also painted in another medium, living organisms. Fleming painted ballerinas, houses, soldiers, mothers feeding children, stick figures fighting and other scenes using bacteria. He produced these paintings by growing microbes with different natural pigments in the places where he wanted different colors. He would fill a petri dish with agar, a gelatin-like substance, and then use a wire lab tool called a loop to inoculate sections of the plate with different species. The paintings were technically very difficult to make. Fleming had to find microbes with different pigments and then time his inoculations such that the different species all matured at the same time. These works existed only as long as it took one species to grow into the others. When that happened, the lines between, say, a hat and a face were blurred; so too were the lines between art and science.

It is not clear why Fleming started painting microbes; perhaps he picked up a brush one day and noticed that it felt like the loop he used for his bacteria. Or maybe it was due to the promiscuous sexual predilections of artists. Fleming worked at St. Mary’s hospital in London, where he treated syphilis cases. Many of his patients were painters, and those painters sometimes gave Fleming paintings and perhaps even lessons in return for treatment. Fleming's palette grew richer with time as he found bacteria with the colors he needed. He found joy in discovering a strange new strain of bacteria, in the way that a field biologist might feel the same in happening upon some new and wondrous bird. He collected unusual life forms in the hope that one of them might someday prove useful.

Fleming was a self-taught artist; he had no real artistic training and so he painted what occurred to him. The paintings had little in the way of dimension or nuance and yet still had a vigor, heightened by the reality that they in fact were alive. As one breathed on the paintings, they breathed back.

One could view these paintings as just another manifestation of the strange ways in which scientists become obsessed (biologists have more than a fair share of quirky hobbies—miniature trains, headstone photography, broken glass collections). But as scientists have begun to reconsider Fleming’s story, it has become clear that these little paintings were more than art.

On that fateful morning, what Fleming actually discovered was, in a way, a version of one of his paintings. Each of the colonies of Staphylococci bacteria that he had inoculated on the plate had grown into a small shape resembling a planet or a star in a night sky. But there among his wild planets was something else, a larger, lighter body at the top of the dish, the Penicillium fungus. Around it the sky was dark, where the bacteria were dying. It was his masterpiece, his “rising sun,” the painting that would save more lives than any other discovery.

Fleming’s discovery of the effects of penicillin, the compound produced by the fungus, was a function of his eye for the rare, an artist’s eye. Other scientists had undoubtedly seen Penicillium growing on their petri dishes before Fleming, but they had thrown those dishes away as failures (In fact, both Chinese and Greek medicine had used fungus topically to treat bacterial infections for several thousand years). Not so for Fleming, who spent his life searching for outliers and the situations that favored them. The outliers were not lucky accidents. They were instead, for Fleming, the living art of discovery.

Nor was his discovery of penicillin an exception. His other discoveries accumulated as he collected other odd observations. Fleming one day hung his nose over a petri dish so to allow his mucus to drip on to the plate. He wanted to see what would happen, what observation would grow out of that strange planting. A new color? A new life form? What he found instead was that his mucus killed bacteria. He had discovered, or he would go on to anyway, lysozyme, a common natural antibiotic that most bodies produce in great quantities. Fleming leapt on the unusual like a weasel on a vole and in doing so discovered what others had walked right past or even thrown, disgusted, into the trash.

Fleming’s bacteria paintings have many descendants. A group of modern painters is using bacteria to produce all sorts of images. Glowing bacteria are used as a scientific tool. The most important descendant of Fleming’s artistic methods, though, are the thousands of modern scientists who, like Fleming, make discoveries by looking for the unusual. You will find them with their messy labs and eyes for oddities. They are bored by experiments that work and prefer those that do not, those whose results make no sense at all. In those moments, they think sometimes that they have found something truly important. Usually they are wrong, but every so often they are right, and our understanding of the world leaps forward. In such moments, the prepared mind favors chance rather than the other way around.