LOS ANGELES (KABC) -- Southern Californians may love their weather and beautiful scenery, but good luck buying your first home. A new study released by Bankrate.com shows Los Angeles is one of the worst metro areas for first-time homebuyers. Bankrate analyzed the 50 largest metropolitan areas in the country and ranked L.A. 49th. Only San Francisco was worse based on 13 factors first-time homebuyers may consider, including affordability, job market, market tightness, culture and safety.And it's not just Los Angeles. California is well represented in the 10 worst metros. Not only is San Francisco ranked 50 out of 50, but San Bernardino came in as the sixth worst.And good luck if you think you can just move somewhere else in the Golden State. Six of the bottom seven worst markets for first-time homebuyers are in California, including Sacramento (48), San Jose (47) and San Diego (44).Bankrate says affordability plays the biggest role. That could explain L.A.'s poor showing, because the median price of homes up for sale right now is just a hair under $800,000. That's four times as expensive as top-ranked Pittsburgh.Unless local housing prices are able to come closer in line with incomes here, L.A. could be facing a serious demographic shift in the near future."We'll become, basically, a luxury place to live in and we won't have a rich and wide range of incomes living here in Los Angeles," said Professor Richard Green, the director of the USC Lusk Center for Real Estate.Green said the high cost of living in L.A. is an even bigger problem when you realize that incomes here are just slightly above average. Southern California's vibrant diversity will suffer, he says, if homes don't become more affordable."We've been importing college graduates, which is a good thing," Green said. "But what the college graduates do is they bid up the price of housing for everyone else, and for the majority of people who don't have a college degree, they're winding up leaving."