I'm using this wordcloud generator to do as the name suggests, and would like to save the contents as .svg. The library has a to_svg() function, which returns a string. It also has a to_file() which doesn't save in this format.
Is there any way to use pyplot's savefig function to save the string output from to_svg() to a file?

pyplot.savefigfor this? You could justwith open('my.svg', 'w') as svg: svg.write(the_string)?