Reputation: Pigs sleep and root in faeces. Pigs sweat like pigs. Pigs are filthy animals. Pigs are pink. Male pigs can orgasm for half an hour.

Reality: These stereotypes are best explained by poor husbandry. In the wild, boars don't sleep and root in poo, they eat plants. They do wallow in mud but only because it's a good way to keep cool. Domesticated pigs are often pink, but only because we made them that way. Male pigs can ejaculate for minutes at a time.

"I don't eat nothin' that ain't got sense enough to disregard its own faeces." So says Jules Winnfield, the hitman played by Samuel L. Jackson in Pulp Fiction, explaining why he doesn't eat pork.

A group of wild boars at Basel Zoo in Switzerland has become famous for its food hygiene

Had Winnfield taken a moment to think, he might not have been so snarky about pigs. Rabbits happily snaffle their own faecal pellets, to give the relatively indigestible grasses a second passage through their digestive system, but nobody is rude about bunnies.

Wild boars – the ancestral stock from which we have fashioned our domesticated pigs – are omnivores, and not too fussy about what they eat. Yet 90% of their diet is made up of plant matter, so they probably don't have a particular taste for poo.

If a domestic pig occasionally munches on the odd turd, it's most likely because its cramped home makes it hard not to.

In fact, a group of wild boars at Basel Zoo in Switzerland has become famous for its food hygiene.

Boars will wallow in mud, but they probably do it to keep cool

The animals were given apple slices coated in sand. Rather than eating them immediately, they carried them "to the edge of a creek running through their enclosure where they put the fruits in the water and pushed them to and fro with their snouts before eating."

The boars would never do this for clean apples. Even if they were really hungry, they still took the time to wash their food.

Aside from their food choices, pigs also have a reputation for being more generally filthy.

Boars will wallow in mud, but they probably do it to keep cool.

Rubbing off a layer of caked mud may also be a nifty way to remove ticks and other parasites

This is because pigs do not have functional sweat glands, which is worth remembering next time someone claims they are "sweating like a pig". This physiological reality means that pigs are at serious risk of overheating, and muddy water evaporates much more slowly than clean water.

"A pig, like any animal, is going to try to be comfortable," says Greger Larson of the University of Oxford in the UK. "If that means getting dirty to stay cool then that's what it's going to do. It would probably find other solutions but those haven't been provided because you're keeping them in relatively dense pens."

A layer of mud on the skin may serve other purposes too, acting like sun cream to prevent the skin from burning, or as an insect repellent to deter mosquitoes and the like. Rubbing off a layer of caked mud may also be a nifty way to remove ticks and other parasites.

Paradoxically then, wallowing in mud may make for clean rather than dirty skin.

It is also worth remembering that the pink, almost hair-free animal that comes to mind at the mention of the word "pig" is a relatively recent human innovation.

Humans have cherry-picked rare mutations that would be quickly eliminated in wild contexts

Domestic pigs, and their wild relatives the wild boars, are just one member of an entire family of piggy animals called the Suidae. The family includes over a dozen species, from warthogs to pygmy hogs, babirusas, giant forest hogs and African bushpigs.

Genetic evidence suggests that wild boars were domesticated twice, from lineages in Asia and Europe. These ancestral boars began to diverge around one million years ago – long before domestication, which happened around 9,000 years ago. Despite this long separation, Asian and European wild boars have exactly the same camouflaged appearance.

The same cannot be said for domestic breeds. In these pigs, the gene encoding coat colour is immensely variable, and accordingly they display a range of colours and patterns.

We have fashioned this diversity in less than 10,000 years, says Larson. In a paper published in 2009, he and his colleagues wrote that "humans have cherry-picked rare mutations that would be quickly eliminated in wild contexts."

There is one final rumour that has to be addressed: the oft-repeated "fact" that male pigs can orgasm for 30 minutes.

According to observations of males with real sows, copulation duration is typically 4-5 minutes, but can last up to 20 minutes

The first thing to say is that we don't know what sensations the males – or the females for that matter – experience when they mate, so any talk of orgasms is speculative.

But based on the ubiquitous "gloved hand" method used to coax sperm from male pigs, ejaculation does appear to last a very long time. In a 2012 study of "high performance boars", the average duration of ejaculation was around 6 minutes. But there was considerable variation, with one male apparently yielding semen continuously for 31 minutes.

It is difficult to know whether this kind of protracted ejaculation can occur in the absence of the "gloved hand", but it is certainly a possibility. According to observations of males with real sows, copulation duration is typically 4-5 minutes, but can last up to 20 minutes.

Whatever the truth about orgasms, an online primer on how to artificially inseminate pigs warns practitioners not to interrupt the male before he's done, unless they want a very angry pig on their hands. "If you let loose too soon, be prepared for a challenge."