May and June are the best times to visit, as far as the weather goes. Spring weather can be quite changeable, especially in March and April, with sunny skies in the morning and storms in the afternoon. April is a good month to beat the crowds and gamble on good weather.
Temperatures often climb above 85 F/30 C in July and August. High humidity (around 85%) causes most locals to flee the city toward the end of summer. Fall remains sunny, with October and November quite mild but sometimes rainy.
September-November is also a nice time to visit—the weather is good for touring, and you'll miss the early-summer crowds. Winters are generally mild, with January lows around 40 F/5 C, but the wind off of the Mediterranean can be chilling, and rain is prevalent.