Coprographia
Coprographia is involuntarily making vulgar writings or drawings. Coprographia comes from the Greek κόπρος, meaning "feces", and γραφή, meaning "writing".
Related terms are coprolalia, the involuntary usage of scatological words, and copropraxia, the involuntary performance of obscene gestures.