Beautiful. I can see you are using your own pyplot-fortran, which is constructing a Python string and evaluating it in Python (right?).
I figured, let’s translate Matplotlib to Fortran, to be more consistent with this thread:
It is 100% pure Fortran, the usual pyplot-style API, and it has svg, png, pdf (and even gif!) backends, the backends are all in pure Fortran, they generate the svg text, or png/pdf/gif binary. I embed the glyphs of a font directly into Fortran sources, support latex-style math rendering, etc.
I needed something to use in the JupyterLite notebooks that LFortran now supports, so since it runs in the browser and must be fast, I needed to generate svg/png directly in pure Fortran.
Anyway, it was super easy to do this thanks to AI, so I think we can now have the full ecosystem from plotting, file formats everything in pure Fortran.