I have a python script that can output a plot using matplotlib and command line inputs.
What i'm doing right now is making the script print the location/filename of the generated plot image and then when PHP sees it, it outputs an img tag to display it.
The python script deletes images that are older than 20 minutes when it runs. It seems like too much of a workaround, and i'm wondering if there's a better solution.