The precise cause of pyoderma gangrenosum is unclear. It is not contagious or infectious. It's linked to autoimmune conditions such as ulcerative colitis, Crohn's disease, and arthritis. It may also be hereditary.