SVG backend and text output

Hi, everyone.

I want to use matplotlib to plot data and render the result in a webpage.

I have found several tutorials showing how to make a temporary file and serving that temporary file.

However, I would prefer to use SVG and thought it might make more sense to return directly the xml code, without having to write to disk and then reading the file again.

I have tried using StringIO without success.

Any ideas on how I can do that?

Thanks in advance for your help.

Kelwin Pina