At the moment I have a code that reads data from a sensor and saves it to a csv file. The code then opens a batch file that calls a python function, csv2odf, which converts the csv into a ODF file with a template of my choosing.
I then have a separate code that reads the orignal csv file and creates a histogram of it and saves it as a PNG. What I have been doing is copy-pasting the PNG into the ODf file. What I want to do however is simply create the report all in one go. So my question is how can I merge these two codes together? Basically I want to save the PNG image to the ODF file that is created using the csv2odf function.
How is your question Octave related? All I see is, you are generating an histogram (maybe using Octave? You didn't say so explicitly?) and save it as PNG. What csv2odf python function do you use? Maybe this one ? Wasn't it easier for your workflow to ask the author of  how to include some graphic? Maybe you can modify his code, as it is GPL free software.