My sample group of two cats is, admittedly, a little lacking for scientific purposes, but I’ll share my observations anyway:
I have never known either of my cats to purr under unpleasant circumstances. They purr when they are snuggled up on their favorite blankets, nestled in my bed and drifting off to sleep. They purr when I’m at my computer and they jump on on my lap (covered as it is by a soft, polar fleece blanket) start kneading the fabric and slowly settle down for a little nap. They purr when I’m gently brushing them and they get that almost pre-orgasmic look on their faces where their eyes kind of roll up and that tranlucent, protective lid covers their eyes. In short, they purr when they are content, safe, and warm. All these observations are corroborated by my wife’s childhood experience with three cats.
Now lest you think that my cats live in a near-purrfect cat nirvana, let me tell you when they don’t purr. They don’t purr when I force open their mouths and shove a dropperful of antibiotics halfway down their throats, squeezing out the chalky medicine and near choking them in the process. They don’t purr when I grab the squirt bottle and let lose with it, their scolding for scratching furniture they know better than to scratch. They don’t purr when they go to the vet and have a stranger lock them down and shove multiple needles in them. They may hiss, mewl, cry, scratch, bite, and kick – but they definitely don’t purr.
Now I’ve got a bit of a nit to pick with dear Unca Cece. In the column Musicat linked to, he starts off by saying that cats will purr when frightened or badly hurt (though never in my experience, as detailed above). He then says that science is a little unclear on the exact mechanism for purring as “it’s very difficult to induce a cat to purr while you are examining his hyoid apparatus.” But why should this be? If they purr when upset as he claims, I’d think a forceful examination of their hyoid apparatus should have them purring up a storm…