Animator Friz Freleng introduced the character in the 1945 cartoon Hare Trigger. With his fiery, irascible temper, short stature (in two early gags in Hare Trigger, a train he is attempting to rob passes right over top of him and he has to use a set of portable stairs to get on his horse; in Bugs Bunny Rides Again, he rides a miniature horse), and fiery red hair, Sam was in some ways an alter-ego of Freleng. The animator often denied any intentional resemblance. However, in the Looney Tunes Golden Collection, surviving members of his production crew assert, and the late director's daughter acknowledges, that Sam definitely was inspired by Freleng.
Other influences were the Red Skelton character Sheriff Deadeye, the Tom Varn character Bubba, and the Tex Avery cartoon "Dangerous Dan McFoo". When he does a "slow burn" and cries "Oooooh!" he borrows a bit from such comedic character actors as Jimmy Finlayson (a frequent foil to Laurel and Hardy) and Frank Nelson (one of Mel Blanc's costars on The Jack Benny Program). Freleng also cited the Terrible-Tempered Mr. Bang, a character in the Toonerville Trolley comic strip, as an influence.
Other characters with Sam-like features appear in several Looney Tunes shorts. The Bugs Bunny entry Super-Rabbit (1943) features the cowboy character "Cottontail Smith", who sounds a lot like Sam. Stage Door Cartoon (1944), another Bugs Bunny offering, features a southern sheriff character that sounds very much like Sam, except for a more defined southern stereotype to his voice. In a Daffy Duck cartoon called Along Came Daffy (1947), Daffy has to contend with two characters who look very much like Sam, one with Sam's red hair and one with black hair. Finally, Pancho's Hideaway (1964) features a Mexican villain who is designed much like Sam but has a different accent. In addition, in the 1949, Chuck Jones-directed cartoon Mississippi Hare, Bugs Bunny battles with an old, pistol-toting gambler called Colonel Shuffle, one whose role could have easily been portrayed by Sam. (The Colonel reappears in "Dog Gone South", this time pitted against Charlie Dog, and accompanied by a bulldog named Belvedere, who resembles Hector the Bulldog.
Freleng created Yosemite Sam to be a more worthy adversary for Bugs Bunny. Until then, Bugs' major foe had been Elmer Fudd, a man so mild-mannered and dim-witted that Freleng thought Bugs actually came off as a bully by duping him. Sam, on the other hand, was extremely violent and belligerent, not at all a pushover like Fudd. Freleng compacted into a tiny body and 11-gallon hat the largest voice and the largest ego "north, south, east, aaaaand west of the Pecos".
For over 19 years, Freleng had almost exclusive usage of Sam at the Warner studio. Though officially a cowboy, Freleng put Sam in a different costume in almost every film: a knight, a Roman legionary, a pirate, a royal cook, a prison guard, a duke (Duke of Yosemite, no less), a Confederate soldier, a mountain climber (climbing the 'Shmadderhorn' mountain in Switzerland), and even a space alien. The humor of the cartoons inevitably springs from the odd miscasting of the hot-tempered cowboy. However, some countries seem to prefer his pirate incarnation, as "Sam the pirate" is his official name in France and a frequent alternative name in Italy. During World War II Yosemite Sam was "drafted" into becoming a mascot emblem for the US Army Air Corps 20th Reconnaissance Squadron.
Despite Freleng's intentions, Sam doesn't prove much brighter than Elmer in his encounters with Bugs. With all his bluff and bluster, Sam stands in contrast to Freleng's calmly cocky rabbit. Sam is significantly tougher and more aggressive than Elmer Fudd when challenging Bugs. He is also quicker to learn from his mistakes, and never falls for the same ploy twice. However it is Sam's own cockiness that always gets the best of him; Bugs learns to deal with Sam upon learning that he is incapable of turning down a challenge. Every time Bugs dares Sam to "step across that line", Sam can't help but do so, even if he steps off into empty space or down a mine shaft.
Another chief foil of Sam's humor is the ludicrous lengths he'll go to just to "get even" -- often with disastrous results to himself and his surroundings.
Yosemite Sam was one of the classic Looney Tunes characters who appeared as faculty members of Acme Looniversity in the 1990s animated series Tiny Toon Adventures. Sam was shown teaching classes in Firearms and Anvilology (the study of falling anvils, a staple joke in the Looney Tunes genre), and was sometimes portrayed as the school principal (though at least one episode identified Bugs Bunny as the principal, and Wile E. Coyote was Dean of Acme Loo). As with all the main Looney Tunes characters, Sam had a student counterpart at Acme Loo, Montana Max.
Yosemite Sam also appeared along with Bugs Bunny in a number of Mirinda commercials in early 90s, most probably due to direct competition to Fanta, being advertised with Disney Characters at that time.
Sam also appeared in two episodes of 1995's The Sylvester and Tweety Mysteries.
In the 2003 movie Looney Tunes: Back in Action, Yosemite Sam is a bounty hunter employed by the Acme Corporation who was hired to finish off DJ Drake, Kate Houghton, Bugs Bunny, and Daffy Duck. In this film, he owns a casino in Las Vegas, which he calls Yosemite Sam's Wooden Nickel, and is accompanied by Nasty Canasta (from Drip-Along Daffy) and Cottontail Smith (from Super Rabbit).
Sam makes a cameo appearance in Who Framed Roger Rabbit He is with his buttocks on fire. He also appears in the movie Space Jam as a player for the TOON SQUAD. In a memorable scene, he and Elmer Fudd shoot off the teeth of one of the Monstars while clad in Pulp Fiction-esque attire.
Sam also plays the role of alien occasional guest villain K'chutha Sa'am (a parody of the Luxan Ka D'Argo from Farscape, and right in line with Sam's aggressive personality) on the Duck Dodgers animated series. He also appears in the video games LOONS: The Fight for Fame, Taz: Wanted, Bugs Bunny Crazy Castle, Bugs Bunny: Rabbit Rampage, Bugs Bunny Lost in Time, Bugs Bunny and Taz Time Busters, Sheep, Dog, 'n' Wolf Looney Tunes B-Ball, Daffy Duck in Hollywood and Loony Tunes: Back In Action the video game.
In Looney Tunes: Acme Arsenal, Yosemite Sam makes an appearance riding a railway cart on the Wild West level.