Butterflies need sunlight, their body has to be warmed by the sun to about 82 degrees to fly. Butterflies like a sheltered area with not much wind since they are delicate and can be blown around a bit. They need close access to shady areas too in the middle of the summer when it gets very hot so they don't get overheated. They love nectar like hummingbirds do. Pick plants that bloom at different times so that there is nectar available in the spring summer and fall.
Fruit trees help too, lots of butterflies like rotting fruit.
You can even put out those rotting bananas that you forgot to eat, this works like a charm. They also love watermelon, pears,and peaches. You can make a butterfly feeder by hanging a plate with a rim to hold your rotting bananas or watermelon slices, add a little orange juice to keep it moist. I used three ropes and a hook. You can also simply stop weeding and cutting an area of your yard and make it a wildflower garden.