The swallowtails inhabit different parts of the San Francisco Bay region. The Western Tiger Swallow is commonly seen in residential and business areas where its foodplant trees have been planted by man. The Anise Swallowtail seems to be found wherever there is a large number of its foodplants - Fennel. This is usually in dry undeveloped fields, hilly areas and parks. They frequently stray into residential areas where there is little Fennel.
Most people consider it a weed.
I've seen Pale Swallowtails and Two-Tailed Swallowtails in the coastal hills that are heavily forested. I have not seen them in the dry and mostly barren East Bay hills.