Butterflies are the ultimate sun worshipers. If you've spent any time observing butterflies at all, you know they spend some of their time basking in the sunshine. Like all insects, butterflies are ectotherms, meaning they can't regulate their body temperatures internally. Instead, they rely on the sun's energy to warm their bodies so they can function. This is especially important on cooler days, because butterflies can't fly when the temperatures dip below about 55° Fahrenheit. You'll see a butterfly perched on a rock or leaf in a sunny spot, with its wings extended, warming up its flight muscles. When you're planning your butterfly habitat, think about providing good basking spots in the sunniest areas of your yard.
In addition, most good nectar plants require partial to full sun. Plant your butterfly garden in an area that gets a solid 6 hours or more of sunshine every day. Pay attention to the seasonal changes, too. The best site for a butterfly garden will get lots of sun from early spring to late fall, not just in the summer months.