Among the 100 largest metropolitan areas. Rankings reflect the metros where the largest (or smallest) share of homes on the market are affordable on the local median income for households headed by 20-34-year-olds. Courtesy of Trulia.

Millennials tend to gravitate to certain cities. They're more likely to live in San Diego than Newark, in Austin than Cleveland, in Washington than Tampa. But these geographic patterns bode poorly for their homeownership prospects: Millennials make up a larger share of the population in many metropolitan areas where they're least likely to afford the housing.

Jed Kolko, the chief economist at Trulia, illustrates this mismatch in the below graph:

Millennials are defined here as 20-34 year-olds to match available Census categories. The Y-axis captures the share of homes for sale on the market in each metro that are affordable on the local median income for households headed by Millennials. Homes are considered affordable when the total monthly payments (including taxes and insurance) add up to less than 31 percent of that median income.

In the above graph, Baton Rouge and Oklahoma City are outliers, metros with many Millennials and plentiful affordable housing. Cleveland, on the other hand, captures one extreme: Millennials there make up 18.4 percent of the population but can afford 71 percent of the homes for sale.

In metro San Diego, they make up nearly a quarter of the population. But just 18 percent of the housing is within their reach. The above calculations also assume a 20 percent down payment, so the affordable housing stock is probably a generous estimation.

As Kolko summarizes their quandary: "Millennials can afford markets where they don’t live, but they can’t afford many of the markets where they do live."

That means that if they do want to buy a home eventually — as survey results suggest that most of them do — many Millennials will probably have to sacrifice the cities that attracted them when they were young.