In gnuplot you can set the output file with set output'path/to/file'. I want to write a short utility script which briefly changes the output to a different file and then resets it.
Since the scripts that use the utility are generated by gnuplottex, I don't know the name of output files and therefore I can't set the output again.
When you want to briefly change terminal, you can do set terminalpush before and set terminal pop after it. AFAIK there's nothing similar with set ouptut.
You can show the current output by showoutput but it goes directly to stdout I couldn't figure how to save it into a variable.