Avoiding People

I have found that when I am feeling anxious and or sad, I want to avoid people outside of my immediate family. When I am around them, I end up having fun usually. I wonder if I suppress the emotions while I am around others or if I am truly enjoying myself. Also, how can I get to the bottom of avoiding people? I really want to be a person of open arms per se. I do love people. Thank you!