Butterflies require only a few things; some nectar, places to perch in the sun, and some damp mud.
If you're wanting to attract more of them, this is where to start.
Full sun is a necessity. Not only do these insects require warmth to keep their blood moving, the flowers that they rely on for their food source also are reliant on full sun exposure to get the best blooms.
In most gardens, there is at least a little area that gets a good six hours of sunshine.
In shadier gardens, you may be out of luck for attracting them.
Another important type of plant for keeping these guys happy are caterpillar host plants. I noticed a huge increase in all kinds of butterflies, from Swallowtails to Commas when the willow shrubs grew up a bit. They use these for shelter when it's raining, or too cool to fly, as well as for their young to feed on.
They also bask in the sun to warm up, and the males will watch for females from this kind of vantage point.
You will need to do some research to find out which shrubs are the host plants for a particular butterfly, to attract and keep them.
There's no point in planting drifts of milkweed if you're in an area that the Monarch butterfly doesn't migrate to for a summer of breeding and raising their young.
Ideally, the best direction is a slope facing south, with taller shrubs and willows, birches and other small trees at the top, and then flowers with landing pad type flowers in drifts, and a dirt path which can be sprinkled with water for them to puddle in.
You will find that gardens that are a little bit messy, or less maintained, will attract more butterflies - as if you needed an excuse to leave the weeds in a nectar corridor, or the grasses and perennials un-pruned for the winter. Lots of insects and small creatures use the dead stems to overwinter in.
When you're building your butterfly garden, it's often disappointing when the butterflies don't instantly appear - don't give up! They'll find your garden, then the magic happens.
It seems that the more butterflies you have, the more your garden attracts.
They will instinctively seek out the action, and search for areas that already have butterflies. Then, before you know it, your garden will be a haven and sanctuary for them.