"Whoever after due and proper warning shall be heard to utter the abominable word 'Frisco', which has no linguistic or other warrant, shall be deemed guilty of a High Misdemeanor, and shall pay into the Imperial Treasury as penalty the sum of twenty-five dollarsnote Worth about $500 in today's money."
As a famously scenic city with a reputation for eccentricity, controversy, and singular history, San Francisco and the surrounding Bay Area pop up fairly frequently in media, particularly visual media, which just love the city's iconic hills and eclectic architecture.
In almost any film or TV show, the cable cars will be made to seem almost everywhere, with the stock establishing shot a cable car cresting over a hill lined with Victorian houses while the Golden Gate bridge is framed in the background. Car chases are frequent in TV and film thanks to the hilly streets and neato views. The city is famous for its liberal politics (the beats and the hippies followed on each other's heels in the mid-20th century), prominent gay population, longtime history as a hub for Chinese immigration, and its reputation for attracting colorful eccentrics who become tolerated or even celebrated in a way they probably wouldn't be anywhere else in America.
In reality, these conventions are all true, but only true to a degree. The cable cars only cover a small part of the city and are favorites of tourists but few locals; the streets are much too narrow and the terrain too varying for a really awesome car chase to happen anywhere but the freeways; and while droves of liberal activists, gays, and immigrants do call San Francisco home, there are as many less visible demographic groups as any other major city.
San Francisco's reputation as a home for misfits and oddballs started with its Gold Rush roots, when it essentially became a mining town that outgrew itself and where fortune-seekers could embrace the mythos of the west and live free of the more stolid conventions of the East or whatever other country they came from. Norton I, Emperor of the United States and Protector of Mexico (whose decree about a certain much-loathed nickname graces the top of the page) is today probably the most famous of all San Francisco eccentrics, but in his time he was just one of a menagerie of strange, self-made hero kooks.
Geographically, San Francisco is rather small for a city of its prominence, since it sits on the end of a peninsula and has no room to grow. The term "Bay Area" refers to the constellation of counties surrounding the San Francisco Bay and their related cities. Oakland, the city on the eastern shore of the Bay, has always been San Francisco's unofficial sister city, these days something of a troubled, hardscrabble town that nevertheless keeps alive the blue collar heritage that the city has lost a bit. Just to the north of Oakland is Berkeley, seat of the region's radical political reputation and home to its most prestigious university. The North Bay, on the other end of the world famous Golden Gate Bridge is characterized by the homes of the ultra rich and the sprawling "wine country" that produces most of California's most notable vintages. And in recent years the South Bay and the Peninsula have come into their own as the seat of Silicon Valley and the engine behind the region's enormous economic boom, driven by social media and software starups of all stripes.
San Francisco sits right on top of the San Andreas fault, and eventual earthquakes are inevitable. Having water on three sides makes the weather wildly unpredictable and generates the famous fog that rolls across half the city at any given time (the fog even has its own Twitter account. Really). Though not as large as other major metropolitan centers, San Francisco is a city of diverse and occasionally clashing neighborhoods, from the famous gay hub in the Castro to the always-trendy Mission District to the uber-rich perched on Nob Hill or the down and dirty poor in the Tenderloin. Some neighborhoods consist of only a few blocks but manage to create their own distinct flavor within that little world. And neighborhoods are often changing: So Ma (South of Market Area, Market being the city's most prominent street) used to be a grungy skid row but in recent decades has gentrified into a trendy business district (although, intriguingly, the area's vogue for BDSM-themed bars and shops remains...).
Though less frequently a trope, San Francisco is also particularly known for its large homeless population, which shows up primarily when a creator showed their work and generally has a point to make with it.
And please don't forget your heart (or your head) when you leave.
Since their last revival, the Teen Titans have lived in San Francisco.
So does Buffy the Vampire Slayer, as it turns out. Her actions have put an end to magic, vampires are a known threat but if she or anyone else kills one that doesn't actively harm humans it will trigger a war, and she currently works for Kennedy as a bodyguard.
The chase scene from the film The Rock is one of the best examples of a car pursuit in that city.
This might be the best example, because it includes nearly every San Francisco and chase scene stereotype in the span of a few minutes. Obscene wealth (it's a Ferrari chasing a Hummer), the Camp Gay Hummer owner and hairstylist, a bottled water truck playing the role of a Fruit Cart, a crashing cable car, a wheelchair race, talking on a cell while driving and a hipster on a dirtbike. Yay!
Bullitt has perhaps the archetypal example and one of the first movie chase scenes to be filmed at real speed rather than having the film sped up.
Another comedic version climaxes the Goldie Hawn-Chevy Chase vehicle Foul Play. ("Far out!")
Freebie and the Bean has a chase scene that ends with a car flying off the (now-demolished) Embarcadero Freeway and landing in the apartment bedroom of an elderly couple.
Parodied in the Starsky & Hutch movie, where doing this wrecks the car. This scene was probably meant as a parody of Bullitt.
Perhaps the only thing filmmakers love to do more than a San Francisco car chase is to destroy the Golden Gate Bridge, as giant monsters, crashing spaceships, supervillains, and natural disasters frequently topple (or at least bust up) the famed span on film. It's worth noting that the 75 year old structure is remarkably sturdy in real life, still considered seismically stable even on its diamond anniversary in 2012.
The silly-ass Dr. Goldfoot and the Bikini Machine, a 1965 comedy staring Vincent Price, has possibly the longest, silliest (rear-projected) car chase ever down San Francisco's Lombard Street - part on location, part green screen, as the antagonists & protagonists switch between on cars, trollies, & even a boat on wheels. Vincent Price makes a great show of looking carsick through it.
Although most of Interview with the Vampire features flashbacks set in New Orleans and Paris, the Frame Story is set in San Francisco. The Scenery Porn is a little more creative than most, if for no other reason that that it emphasizes the less famous (but far more widely used) Bay Bridge rather than the Golden Gate.
Decades before the disaster films of the 70s, the 1936 eponymously named film tells the story of rival saloon owners, a singer and the 1906 earthquake. The scenes during and after the earthquake are still terrifying to watch today.
San Francisco is the primary setting for the first and third books of William Gibson's Bridge Trilogy, Virtual Light and All Tomorrow's Parties (the second book, Idoru, takes place mostly in Tokyo). The city is depicted as struggling to recover from a massive earthquake (a lot like it was in real life in the early 90s, when the first book was being written), and much of the action takes place in a shantytown constructed on the ruins of the Bay Bridge (from which the trilogy gets its name).
San Francisco and the nearby area is the primary setting for The Fire Rose by Mercedes Lackey.
Little Brother is set in San Francisco after a hypothetical terrorist attack on the Bay Bridge.
In The Secrets of the Immortal Nicholas Flamel, most of the characters live in San Francisco. It later turns out that the Dark Elders have turned Alcatraz into a prison for monsters that they plan to release on the city as the first step in their campaign to take over the world.
In Percy Jackson and the Olympians, San Francisco is considered dangerous territory for demigods since Mount Othrys, the Titans' fortress, is currently located on top of Mount Tamalpais.
An episode of The Evidence had a murderer attempt to kill someone by sabotaging their brakes so they would fail on one of San Francisco's steep hills. The sabotaged car ends up ploughing into the detectives' car.
During The Sixties, the Presidio was still a working military base (though so low security you could drive through it). It's since become a park managed by a national trust, making it almost impossible that Starfleet could ever build there now.
In a crowning stroke of irony, there is one famous company that owns a significant amount of property there today: Lucasfilm.
Charmed is set, but clearly not filmed, in San Francisco. Almost every episode begins with Scenery Porn of the city. The manor exteriors are in LA.
Nash Bridges also took extensive advantage of filming in San Francisco, including museums, piers, and enough landmarks to deeply satisfy viewers who live in the city. The show's production was headquartered on Treasure Island and brought $2 million of business to San Francisco per episode.
In the final episode of Frasier, Frasier is offered a TV gig in San Francisco, but is at first hesitant. His agent tries to persuade him by implying the advantage of being a straight man in a city where, supposedly, so many men are... not interested in women.
Full House is based here in the area surrounding Alamo Square park.
Aaron Spelling's '80s drama Hotel was set in San Francisco, a change from the New Orleans setting of the novel and film it was adapted from.
A Late Arrival Spoiler in How I Met Your Mother is the time Lily broke her and Marshall's engagement in a panic and ran off to San Francisco for three months. References to San Francisco in this context occur from time-to-time in the show, for example: Lily (who is notoriously lustful) mentions that it was the longest stretch of time she had ever gone without sex, driving her crazy to the point where, when one of San Francisco's famously frequent earthquakes occurred, she got off on the vibrations.
McMillan and Wife
Alcatraz is set here (though, as with many others, filmed in Vancouver).
A large number of racing games feature San Francisco as well, though in those games, it usually makes sense that the streets are empty, since they've been closed off for a race.
Grand Theft Auto: San Andreas features a parody of San Francisco called San Fierro. Although there are examples of the famous stairway streets, the whole city is quite small, and they are few and far between. Other famous parts of San Francisco, including the thick fog and the twisting road on the steep hill, are thrown in for good measure. Lombard Street makes an appearance as "Windy Windy Windy Windy Street," and the Transamerica Building (the tallest in the city) as the "Big Pointy Building" — both decent enough descriptions.
The city is quite small in real-life as well; it's only about seven miles on each side...and many parts of that are generally considered to be "the middle of nowhere".
A disproportionate number of Sega Dreamcast videogames featured San Francisco (or locations heavily based on it):
Interestingly, the two driving stages in the game are "Highway 101" and "Highway 280". Although these are actualhighway names, the stages themselves don't resemble the highways they're named after.
Super Runabout: San Francisco
The San Francisco Rush series of Driving Games is two-thirds Exactly What It Says on the Tin. It also has spectators. Who scream in terror when a racer careens out of control at them, and it's possible to jump the entire length of Lombard Street.
One of the second Destroy All Humans! game's locales is "Bay City", which is essentially an Expy of this city. As the game is set in 1969, the area is full of hippies and hippie culture.
One of the tracks in Mario Kart 8 is a combination of San Francisco and New York City, complete with steep streets and cable cars.
The Nancy Drew PC game Message In A Haunted Mansion took place in San Francisco. Though it didn't make much use of the scenery (being something of a Bottle Episode that only took place in one location,) it did involve the infamous 1906 earthquake in part of the backstory.
Parodied on The Simpsons in the form of a Troy McClure movie entitled Goodtime Slim, Uncle Doobie, and the Great Frisco Freakout.
"There's more than one way to get high!"
Also on The Simpsons: when they're escaping from Alcatraz by swimming, Lisa says "Swim to San Francisco!" Homer responds with the classic line: "I'm not made of money! We'll swim for Oakland!" From the episode "Bart-Mangled Banner", written by John Frink; No evidence so far to suggest he lived in the Bay Area, though.
Jackie Chan Adventures, is based in the Chinatown neighborhood and the city gets front row seats to some of the magical activities of the main characters and vilians. It almost gets destroyed in the a couple of episodes.
Monsters vs. Aliens features a big battle in San Francisco, complete with car chase (sort of; Ginormica uses cars to skate down the streets) and a Monumental Battle on the Golden Gate bridge.
In one episode of Kim Possible, Shego and Senor Senior, Junior go to San Francisco to steal the last intact copy of the Tome of Treachery. Shego ends up fighting Kim, and both Junior and Ron have trouble finding a parking space. (Locals can assure you that parking is truly miserable. Bike, if you're up for the hills, or use the public transportation.)
While animated series are usually set to fictional cities or towns, The Mighty B! and Robotboy both take place in San Francisco.
The South Park episode "Smug Alert!" ripped into the city for its obsession with hybrid cars. The reduction of smog from their cars was causing a massive cloud of smug to ravage the western U.S.