Nicolas, attached is a patch (relative to master from a few minutes ago) which allows gnuplot babel blocks to send the output to the right directory. I have tested this with both buffers associated with actual files and buffers not associated with any file. Your suggestion for getting the directory name worked just fine. Thanks, eric