Courtesy of Flickr user Philip Taylor, under a Creative Commons license.

Reliably liberal San Francisco has some of the most expensive housing in the country, as do heavily blue New York City and Los Angeles. At the other end of the political spectrum, housing often costs less in conservative parts of the country. These are the places — around Greenville, S.C., or Knoxville, Tenn. — that tend to be less dense, where land is cheaper and the large homes on top of it more affordable to the middle class.

Between these two poles, though (metro San Francisco voted for Obama by 58 points, metro Knoxville for Romney by 34 points), the relationship between housing affordability and politics across the country is startlingly strong. Consider this chart, from an analysis today by Trulia's chief economist, Jed Kolko:

Kolko looked at the 100 largest metros in the country (these include core cities and their suburbs), according to their vote margins in the 2012 presidential election. The results show that there is affordable housing in red and blue metros. But the most expensive metros are overwhelmingly blue, with just one exception: Orange County, Calif.

Nine of the 10 bluest markets had median home asking prices above $130 per square foot. All of the 10 reddest markets had prices below that. In the dark blue markets, housing cost almost twice as much ($227 per square foot) as in the red ones ($119). In metro Washington — this is not just the District — the average home asking price was about $177.

Relatedly, homeownership tends to be lower in dark-blue metros, and inequality higher.

All of this doesn't mean that Democrats prefer expensive homes, or are even better able to afford them. In fact, while people tend to make more money in high-cost parts of the country than low-cost ones, those income gains often aren't enough to cover the higher cost of housing there.

This also doesn't mean that liberal politics necessarily cause housing to be expensive (although it's true that restricting new development does, and this often happens in land-constrained coastal cities like San Francisco and Boston). What this does mean is that the politics of housing are different — and the problems posed by its high costs are greater — in many blue places than red ones, whether we're talking about housing affordability, access to homeownership or inequality.