Ed Loftus, an Oakland artist known for his hyper-realistic graphite drawings, sat in a cafe in downtown San Francisco last week talking about how he had become obsessed with his hair. “It sounds nuts, but all I could think about was getting my hair cut,” he said. “It’s like: I should get my hair cut. When am I going to get my hair cut? Why am I thinking about getting my hair cut? I wish I could stop thinking about getting my hair cut.”

His hair fixation has nothing to do with vanity, but rather with obsessive-compulsive disorder — an anxiety illness that causes intrusive thoughts and repetitive behavior like tapping or humming to quell constant uneasiness. It is a condition that Mr. Loftus, 38, has wrestled with since his childhood in England.

The fruits of Mr. Loftus’s obsessive nature are on display at the Gregory Lind Gallery in San Francisco, through Jan 21. “Big Things to Avoid,” Mr. Loftus’s first solo show in six years, features small pencil drawings that are at once photo-realistic and surreal: a skeleton walking through a mountainous landscape taken from an Ansel Adams photograph; the artist’s childhood sweetheart swarmed by birds against a hazy sky.

The works are rendered in painstaking detail — partly a result of the disorder — and a single piece can take up to five months to complete. In the last three years, Mr. Loftus has produced 10 works.