Being able to generate TeX graphics can be useful for several reasons:
The TeX text engine is powerful and can render any complex math formulae. But more tricky is the graphics rendering: lines, polygons, markers etc … One possibility is to render them using PDF or PostScript and render the text using TeX. But that’s not very practical as two files are needed to render one picture. A better way is to use a dedicated environment like PGF/TikZ.
This is a companion discussion topic for the original entry at https://root.cern/blog/saving-canvas-in-TeX/