You may have a look at this: https://blog.wolfram.com/2012/10/05/automating-xkcd-diagrams-transforming-serious-to-funny/